Jump to content

Recommended Posts

Posted

Since updating MarkupHTMLPurifier (1.0.3)  I get an error when puttng text in a textarea field: 

Compile Error
Array and string offset access syntax with curly braces is no longer supported

3889:            // codepoints.  Instead of having to convert back into UTF-8, we've
3890:            // decided to directly append valid UTF-8 characters onto a string
3891:            // $out once they're done.  $char accumulates raw bytes, while $mUcs4
3892:            // turns into the Unicode code point, so there's some redundancy.
3893:    
3894:            $out = '';
3895:            $char = '';
3896:    
3897:            $len = strlen($str);
3898:            for ($i = 0; $i < $len; $i++) {
3899:                $in = ord($str{$i});

3900:                $char .= $str[$i]; // append byte to char
3901:                if (0 == $mState) {
3902:                    // When mState is zero we expect either a US-ASCII character
3903:                    // or a multi-octet sequence.

It also happens when I edit the field in previous pages. What could be causing this?

Posted

I think the error message is pretty straightforward in this case:

"Array and string offset access syntax with curly braces is no longer supported"

On line 3899 from your excerpt, a variable called "str" (which I assume holds a String value), is extracting an offset using curly braces, something that much older versions of PHP supported, but has been deprecated for awhile now.

How old is the ProcessWire version that you are using? From checking Github and looking at my own sites, the MarkupHTMLPurifier module is currently at version 4.9.7, is included in the core so does not need to be installed separately, and hasn't been updated in over 4 years (the Markdown README was updated 2 years ago).

If you upgraded the module separate from the rest of the core, it's entirely possible that there are incompatibilities due to not all core modules being updated simultaneously, thus the problem(s) you're experiencing with text in a textarea field.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...