• Resolved rocuments

    (@rocuments)


    PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in ./wordfence/vendor/wordfence/wf-waf/src/lib/json.php on line 181

    $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});

    since PHP 7.4 curly braces method to get individual characters inside a string has been deprecated, so change the above syntax into this:

    $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);

    thank
    R

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @rocuments, thanks for dropping us a message about this suggestion.

    There is a development case open for the issue you mention which will be addressed in an upcoming release. This can only happen if PHP has the JSON module disabled, which will not be possible in PHP 8, so you can suppress the error for now by enabling the JSON module in 7.4.

    Thanks,

    Peter.

    how do you enable the JSON module ?

    Plugin Support wfpeter

    (@wfpeter)

    Hi @aalfonso,

    As this is a resolved topic, we wouldn’t necessarily notice further responses so long after the original posts but I just happened to see this one.

    Enabling the JSON module is a PHP issue rather than Wordfence, so a Google search should help you out if you have further questions but I will highlight the basic steps for an apache server here. If you are on shared hosting or a different operating system, you may need to contact your host directly for help as they don’t always allow access to these files:

    • Open the file /etc/php5/apach2/php.ini
    • Add extension=json.so on a new line at the end of the file.
    • restart apache2 sudo service apache2 restart

    Please start a new topic if you have any further Wordfence issues and we’ll always be glad to help out!

    Thanks,

    Peter.

    Is not working.
    Fatal error: Array and string offset access syntax with curly braces is no longer supported in

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Fatal error: curly braces is no longer supported’ is closed to new replies.