Support » Plugin: Equation Editor » Plugin breaks TinyMCE in PHP 7.4

  • In PHP 7.4, the implode() function now throws an exception when passing the glue and pieces in the wrong order.

    This causes line 2732 of /equation-editor-fork/tiny_mce_wiris/core/core.js to fail because it sees a PHP warning string rather than a valid JSON string.

    Here’s the error:

    "<pre>uncaught exception: <b>join(): Passing glue string after array is deprecated. Swap the parameters (errno: 8192) in /home/public_html/wp-content/plugins/equation-editor-fork/tiny_mce_wiris/integration/lib/php/Boot.class.php at line #835join(): Passing glue string after array is deprecated. Swap the parameters</b><br /><br />in file: /home/public_html/wp-content/plugins/equation-editor-fork/tiny_mce_wiris/integration/lib/php/Boot.class.php line 835<br />#0 [internal function]: _hx_error_handler()
    #1 /home/public_html/wp-content/plugins/equation-editor-fork/tiny_mce_wiris/integration/lib/php/Boot.class.php(835): join()
    #2 /home/public_html/wp-content/plugins/equation-editor-fork/tiny_mce_wiris/integration/lib/php/Boot.class.php(854): _hx_build_paths()
    #3 /home/public_html/wp-content/plugins/equation-editor-fork/tiny_mce_wiris/integration/lib/com/wiris/system/CallWrapper.class.php(44): require_once('/home/...')
    #4 /home/public_html/wp-content/plugins/equation-editor-fork/tiny_mce_wiris/integration/plugin.php(5): com_wiris_system_CallWrapper->init()
    #5 /home/public_html/wp-content/plugins/equation-editor-fork/tiny_mce_wiris/integration/pluginbuilder.php(3): require_once('/home/...')
    #6 /home/public_html/wp-content/plugins/equation-editor-fork/tiny_mce_wiris/integration/configurationjs.php(5): require_once('/home/...')
    #7 {main}</pre>"

    As a result of this, the TinyMCE editor (Classic Editor) breaks and can’t swap between modes or save correctly.

    • This topic was modified 11 months, 1 week ago by pikamander2.
    • This topic was modified 11 months, 1 week ago by pikamander2.
    • This topic was modified 11 months, 1 week ago by pikamander2.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pikamander2

    (@pikamander2)

    Here’s the fixed _hx_build_paths function:

    function _hx_build_paths($d, &$_hx_types_array, $pack, $prefix) {
    	$h = opendir($d);
    	while(false !== ($f = readdir($h))) {
    		$p = $d.'/'.$f;
    		if($f == '.' || $f == '..')
    			continue;
    			if (is_file($p) && substr($f, -4) == '.php') {
    			$bn = basename($f, '.php');
    			if ($prefix)
    			{
    				if ($prefix != substr($bn, 0, $lenprefix = strlen($prefix)))
    					continue;
    				$bn = substr($bn, $lenprefix);
    			}
    			if(substr($bn, -6) == '.class') {
    				$bn = substr($bn, 0, -6);
    				$t = 0;
    			} else if(substr($bn, -5) == '.enum') {
    				$bn = substr($bn, 0, -5);
    				$t = 1;
    			} else if(substr($bn, -10) == '.interface') {
    				$bn = substr($bn, 0, -10);
    				$t = 2;
    			} else if(substr($bn, -7) == '.extern') {
    				$bn = substr($bn, 0, -7);
    				$t = 3;
    			} else
    				continue;
    			$qname = ($bn == 'HList' && empty($pack)) ? 'List' : implode('.', array_merge($pack, array($bn)));
    			$_hx_types_array[] = array(
    				'path' => $p,
    				'name' => $prefix . $bn,
    				'type' => $t,
    				'qname' => $qname,
    				'phpname' => implode('_', array_merge($pack, array($prefix . $bn)))
    			);
    		} else if(is_dir($p))
    			_hx_build_paths($p, $_hx_types_array, array_merge($pack, array($f)), $prefix);
    	}
    	closedir($h);
    }

    I did a quick grep search and didn’t find any other instances of join() or implode() in the plugin’s code, but it’s probably a good idea to double check that.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @pikamander2 There is nothing here that needs reporting. The “Report this topic: link is not for getting faster support. It’s for reporting abuse, spam and broken posts in the forums. It only gets the attention of the forum moderators.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin breaks TinyMCE in PHP 7.4’ is closed to new replies.