We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33479
    • 15 Posts
    TinyMCE has recently started adding \& quot; when saving. Really messing up classes and images in html. After poking around Google, on a whim I changed the "Entity Encoding" option on the TinyMCE configuration tab from named to raw. Since doing this I have the following system alert popping up and TinyMCE doesn't load.

    TinyMCE Rich Text Editor - OnRichTextEditorRegister
    An error occurred while loading. Please see the event log for more information.

    Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting T_STRING in /home/zerograv/public_html/manager/includes/document.parser.class.inc.php(790) : eval()'d code on line 2
    TinyMCE Rich Text Editor - OnRichTextEditorInit
    An error occurred while loading. Please see the event log for more information.

    Parse error: syntax error, unexpected T_NS_SEPARATOR, expecting T_STRING in /home/zerograv/public_html/manager/includes/document.parser.class.inc.php(790) : eval()'d code on line 2

    I changed the setting back to named and still get the system alert. Can someone tell me how to fix the system alert and also stop Tinymce adding \& quot;. It doesn't remove the double quote just adds the code.

    Evo 1.0.6
    PHP 5.3.10
    MySQL 5.0.95-community
    I don't have access to php.ini and php_flag in htaccess gives server 500 errors.

    Many Thanks
      Darren Burns
      Zero Gravity Web Works
      • 33479
      • 15 Posts
      After digging some more I found this code and added it to the index.php in the manager folder. I imagine this may not be the preferred method but it has fixed the \& quot; issue. Is there a preferred method to fix magic quotes being on? The System Alert Still remains though.

      // turn off Magic Quotes
      if (get_magic_quotes_gpc()) {
          $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
          while (list($key, $val) = each($process)) {
              foreach ($val as $k => $v) {
                  unset($process[$key][$k]);
                  if (is_array($v)) {
                      $process[$key][stripslashes($k)] = $v;
                      $process[] = &$process[$key][stripslashes($k)];
                  } else {
                      $process[$key][stripslashes($k)] = stripslashes($v);
                  }
              }
          }
          unset($process);
      }

        Darren Burns
        Zero Gravity Web Works
        • 19369
        • 1,098 Posts
        Have you tried to upload in the root a php.ini file that disables Magic Quotes? You don't have access at all to php.ini?
          • 33479
          • 15 Posts
          It is a shared hosting account. I have contacted support to see if a php.ini in the root will work. In the meantime the code above is doing the trick for anyone who can't get to a php.ini.

          As for the other problem I found the solution on this thread. http://forums.modx.com/thread/75590/tinymce---adding-to-links-and-formatting. I had all the same slashes in the plugin code.

          I guess the problems were related but turning off magic quotes and copying the TinyMCE plugin code back fixed both problems.
            Darren Burns
            Zero Gravity Web Works
            • 41296
            • 1 Posts
            I had this exact same error didn't have access to php.ini or htaccess,
            ended up using the code above at the TOP of the file for it to kick in,.....
            hope that helps.
            Chris