# ajaxCRUD – PHP 8 modernization notes

Tested on PHP 8.3 + MariaDB 10.11 (all example pages, ajax update/delete, add, filter, sort, paging, upload, CSV).

## Setup
Edit `preheader.php` (DB host/user/pass/name). mysqli is required. Set `$AJAXCRUD_DEBUG = TRUE` only while developing.

## Compatibility fixes
- Class file converted from ISO-8859-1 to UTF-8; corrupted accent table replaced (`make_filename_safe`).
- `preheader.php`: mysql_* fallback removed, mysqli exceptions handled, utf8mb4, no closing tag.
- Fixed PHP 8 fatals: `mysqli_error()` without args, unquoted array keys (`[id]`), `count(false)`.
- Removed `utf8_encode` (deprecated 8.2); declared previously dynamic properties; `#[AllowDynamicProperties]` kept for user subclasses.
- Undefined index / null-to-string warnings fixed throughout.
- Fixed: dropdown editor JS variable typo; `$LOCAL_JS` not visible in class (now defaults to bundled JS).
- Examples: short `<?` tags replaced with `<?php`; undefined variables fixed.

## Security
- All SQL values escaped, identifiers validated/backticked; sort/filter fields whitelisted.
- Ajax update/delete only for tables rendered in the session, real editable columns, and when delete is allowed.
- Server-side scripts (php, phtml, phar, ...) blocked on upload; upload names sanitised.
- Output escaped; CSV export filename sanitised.

## Behaviour changes
- Raw cell data is HTML-escaped on display. Use `$tbl->allowHtmlOutput()` to opt out. Output of your own `formatFieldWithFunction` callbacks is trusted – escape inside them.
- CSV export uses RFC 4180 quoting.
- `$LOCAL_JS` default is TRUE.

## Not changed
Bundled jQuery 1.8.3 / validate 1.7 are old; no CSRF tokens; `.htaccess` (cPanel generated) untouched.
