Support » Fixing WordPress » tinyMCE undefined when realpath disabled

  • IMPORTANT: THIS IS FOR ANYBODY THAT HAS FUNCTION realpath DISABLED BY THE SERVER

    I’ve found a way to manage and override the usage of realpath function in order to see the tinyMCE toolbar.

    First step:
    Edit tiny_mce_gzip.php and just below

    @require_once('../../../wp-config.php'); // For get_bloginfo().

    add the following code:

    // beggining of myRealPath
    
      function myRealPath($path) {
    
        // check if path begins with "/" ie. is absolute
        // if it isnt concat with script path
        if (strpos($path,"/") !== 0) {
            $base=dirname($_SERVER['SCRIPT_FILENAME']);
            $path=$base."/".$path;
        }
    
        // canonicalize
        $path=explode('/', $path);
        $newpath=array();
        for ($i=0; $i<sizeof($path); $i++) {
            if ($path[$i]==='' || $path[$i]==='.') continue;
               if ($path[$i]==='..') {
                  array_pop($newpath);
                  continue;
            }
            array_push($newpath, $path[$i]);
        }
        $finalpath="/".implode('/', $newpath);
    
        // check then return valid path or filename
        if (file_exists($finalpath)) {
            return ($finalpath);
        }
        else return FALSE;
    }
    
      // end of myRealPath

    Second step:
    Edit and replace inside tiny_mce_gzip.php
    realpath
    into
    myRealPath

    This should get your tinyMCE toolbar working. Make sure that you have “Use the visual editor when writing” under your profile selected.

    If you have some doubts, send mail to: mail@muchacholoco.com.ar

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thanks! This really helped me out!

    Thanks a lot ! I was working on the problem and this is the only thing that did the trick.

    Respect 🙂

    This was the only solution out of about 10 that worked! thank you SO much!!

    diismalley

    (@diismalley)

    Thanks, I was also having this problem and it fixed it straight away. Only problem is I really find the inbuilt editor very restrictive and want to use the plugin – Advanced Tiny MCE Editor and as soon as I turn the plugin on the whole Editor disappears again. Any thoughts on this please?
    You all just blow me away by how much you know!

    many thanks

    Thanks, at last a solution that worked!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘tinyMCE undefined when realpath disabled’ is closed to new replies.