Support » Plugin: wp-Typography » mb_substr_count()

  • Resolved clevelus

    (@clevelus)


    Warning: mb_substr_count() …
    All post on GeneratePress Theme not visible. Only Warning.
    Deactivate plain is fine.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author pepe

    (@pputzer)

    @clevelus, what‘s the text of the warning?

    Thread Starter clevelus

    (@clevelus)

    See now (I’m enabled plugin for 15 minutes)
    Warning: mb_substr_count() expects at most 3 parameters, 4 given in … wp-content/plugins/wp-typography/vendor/masterminds/html5/src/HTML5/Parser/Scanner.php on line 249

    https://clevelus.ru

    Plugin Author pepe

    (@pputzer)

    Thanks. It looks like your installation is somehow overloading substr_count, because that’s the function that is actually called in that line:

    return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1;

    The parameter signatures for substr_count and mb_substr_count are completely different, so it is expected that the later would fail. That would appear to be an issue with your PHP installation, not the plugin.

    Thread Starter clevelus

    (@clevelus)

    All plugins on all sites and not only WordPress work without problems, except for your plug-in, but PHP 7.1 is to blame? )))

    Plugin Author pepe

    (@pputzer)

    No. Something on you installation (probably the deprecated mbstring.function_overload setting) is remapping the built-in string function substr_count to mb_substr_count, even though those two functions are not signature-compatible.

    Thread Starter clevelus

    (@clevelus)

    Problem with parameter
    mbstring.func_overload = 2
    Your plugin requires
    mbstring.func_overload = 0
    (this is also a recommendation for WordPress)

    Plugin Author pepe

    (@pputzer)

    @clevelus: It really should not be enabled for any at least semi-modern PHP code. Yours is the first bug report regarding this, but maybe I’ll add it to the requirements checks on start-up.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘mb_substr_count()’ is closed to new replies.