Support » Requests and Feedback » add mb_strstr() to compat.php

  • Resolved Mitchell D. Miller


    compat.php is

    WordPress implementation for PHP functions either missing from older PHP versions or not included by default.

    WP has mb_substr(), mb_strlen() for sites without multibyte string extension.

    Please add mb_strstr() to compat.php.

    I added mb_ functions to my Quick Mail plugin for Russian translation, and to be compatible with more languages.

    Unfortunately, it produced:

    Uncaught Error: Call to undefined function mb_strstr()

    I am updating plugin to test if mb_strstr() exists, before using it. But it might produce incorrect results, if it falls back to strstr().

    It would be better if WordPress offered an internal version, that could be used by all plugins and themes.

    Thank you,

Viewing 1 replies (of 1 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Please add mb_strstr() to compat.php.

    Umm.. No, the compat.php functions are for compat functions that WordPress itself uses. Not for arbitrary compatibility.

    WordPress does not use the mb_* functions, therefore it does not need compat functions for it. If you need such a function, then you should add it in your plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘add mb_strstr() to compat.php’ is closed to new replies.