Title: Plugin breaks TinyMCE in PHP 7.4
Last modified: June 10, 2020

---

# Plugin breaks TinyMCE in PHP 7.4

 *  [pikamander2](https://wordpress.org/support/users/pikamander2/)
 * (@pikamander2)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/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 5 years, 11 months ago by [pikamander2](https://wordpress.org/support/users/pikamander2/).
    -  This topic was modified 5 years, 11 months ago by [pikamander2](https://wordpress.org/support/users/pikamander2/).
    -  This topic was modified 5 years, 11 months ago by [pikamander2](https://wordpress.org/support/users/pikamander2/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [pikamander2](https://wordpress.org/support/users/pikamander2/)
 * (@pikamander2)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/plugin-breaks-tinymce-in-php-7-4/#post-12965641)
 * 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](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [5 years, 11 months ago](https://wordpress.org/support/topic/plugin-breaks-tinymce-in-php-7-4/#post-12965771)
 * [@pikamander2](https://wordpress.org/support/users/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.

 * ![](https://s.w.org/plugins/geopattern-icon/equation-editor_ffffff.svg)
 * [Equation Editor](https://wordpress.org/plugins/equation-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/equation-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/equation-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/equation-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/equation-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/equation-editor/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/plugin-breaks-tinymce-in-php-7-4/#post-12965771)
 * Status: not resolved