• I was told to edit functions.php to change something I did and now error logs are filled with an error at line 4205

    This is how it ends. What did I delete by mistake?

    encoding()
    *
    * @since 3.7.0
    *
    * @param bool $reset Whether to reset the encoding back to a previously-set encoding.
    */
    function mbstring_binary_safe_encoding( $reset = false ) {
    static $encodings = array();
    static $overloaded = null;

    if ( is_null( $overloaded ) )
    $overloaded = function_exists( ‘mb_internal_encoding’ ) && ( ini_get( ‘mbstring.func_overload’ ) & 2 );

    if ( false === $overloaded )
    return;

    if ( ! $reset ) {
    $encoding = mb_internal_encoding();
    array_push( $encodings, $encoding );
    mb_internal_encoding( ‘ISO-8859-1’ );
    }

    if ( $reset && $encodings ) {
    $encoding = array_pop( $encodings );
    mb_internal_encoding( $encoding );
    }
    }

    /**
    * Resets the mbstring internal encoding to a users previously set encoding.
    *
    * @see mbstring_binary_safe_encoding()
    *
    * @since 3.7.0
    */
    function reset_mbstring_encoding() {
    mbstring_binary_safe_encoding( true );
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • It’s very hard to tell without knowing which line is4205, but I’m guessing that it’s this?

    encoding()
    *

    If that’s right, then the anser is pretty ovbious.

    There needs to be a ; at the end of every PHP line of code to tell the server where to stop the processing for that line. There’s also the problem that you’re continuing a comment block without actually starting it.

    Try something like this…

    encoding();
    /**

    If that’s the problem, that will fix it.

    Thread Starter SickSquirrel

    (@sicksquirrel)

    Thanks. Checked another file at an untouched site. Looks identical

    see reset_mbstring_encoding()
    *
    * @since 3.7.0
    *
    * @param bool $reset Whether to reset the encoding back to a previously-set encoding.
    */
    function mbstring_binary_safe_encoding( $reset = false ) {
    static $encodings = array();
    static

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Broke functions.php’ is closed to new replies.