PaulB
Well-known member
- Affected version
- 2.2.11
This is a collection of patches for PHP 8.2 compatibility issues I've encountered. It's not intended to be used on a live site and just serves as a checklist of known issues.
Currently, this includes:
Currently, this includes:
HTML-ENTITIES
encoding is deprecated:- \Symfony\Component\VarDumper\Dumper\HtmlDumper::dumpLine
- \Symfony\Component\DomCrawler\Crawler::addHtmlContent
- utf8_decode and utf8_encode are deprecated:
- src/vendor/dokuwiki/utf8/utf8.php: utf8_decode replaced with mb_convert_encoding to preserve existing, buggy behavior (see note below for caveats)
- Missing properties:
- \XF\AddOn\DataType\AbstractDataType: $structure
- \XF\Http\Stream: $stream
- Various GuzzleHttp stream implementations: $stream
- \XF\Payment\CallbackState: unknown number of properties; added
#[\AllowDynamicProperties]
- \GuzzleHttp\Handler\CurlMultiHandler: unknown number of properties; added
#[\AllowDynamicProperties]
- \Less_Tree: $parensInOp, $allExtends
- Typos in property names that only started triggering errors in PHP 8.2; previous versions of PHP supported dynamic properties:
- \XF\BbCode\ProcessorAction\AnalyzeUsage::initialize: $smiliesCount vs $smilieCount
- \XFMG\Ffmpeg\Runner::setFileName: $filename vs $fileName
- Deprecated callable syntax:
- SwiftMailer: lots of occurrences
- \Symfony\Component\Console\Helper\QuestionHelper::formatChoiceQuestionChoices
- Any issues that exist outside XF, XFES, XFMG, XFRM, XFI, and their included libraries. Notably, XFAws is incompatible with PHP 8.2 as of writing.
- The fixes for utf8_encode and utf8_decode aren't ideal. Many usages of utf8_* make incorrect assumptions about languages and encoding. For example, although this patch allows wholeWordTrimAroundLength to run without erroring, it doesn't fix wholeWordTrimAroundLength's buggy behavior with certain languages. Most bugs stemming from utf8_* usage will be minor and don't require urgent fixes, but if you're an add-on developer, it's worth reassessing how you handle string comparisons and length calculations on UTF-8 text.
Attachments
Last edited: