Make WordPress Core


Ignore:
Timestamp:
03/07/2007 04:26:26 AM (20 years ago)
Author:
ryan
Message:

Update to tinyMCE spellchecker 1.0.3.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php

    r4747 r4985  
    88 * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
    99 */
     10
     11        // Ignore the Notice errors for now.
     12        error_reporting(E_ALL ^ E_NOTICE);
    1013
    1114        require_once("config.php");
    … …  
    3134        // Get input parameters.
    3235
    33         $check = $_POST['check'];
    34         $cmd = sanitize($_POST['cmd']);
    35         $lang = sanitize($_POST['lang'], "strict");
    36         $mode = sanitize($_POST['mode'], "strict");
    37         $spelling = sanitize($_POST['spelling'], "strict");
    38         $jargon = sanitize($_POST['jargon'], "strict");
    39         $encoding = sanitize($_POST['encoding'], "strict");
    40         $sg = sanitize($_POST['sg'], "bool");
     36        $check = urldecode($_REQUEST['check']);
     37        $cmd = sanitize($_REQUEST['cmd']);
     38        $lang = sanitize($_REQUEST['lang'], "strict");
     39        $mode = sanitize($_REQUEST['mode'], "strict");
     40        $spelling = sanitize($_REQUEST['spelling'], "strict");
     41        $jargon = sanitize($_REQUEST['jargon'], "strict");
     42        $encoding = sanitize($_REQUEST['encoding'], "strict");
     43        $sg = sanitize($_REQUEST['sg'], "bool");
    4144        $words = array();
    4245
    … …  
    9194                                $result = $tinyspell->checkWords($words);
    9295                        break;
     96       
    9397                        case "suggest":
    9498                                $result = $tinyspell->getSuggestion($check);
    9599                        break;
     100
    96101                        default:
    97102                                // Just use this for now.
    … …  
    110115                case "xml":
    111116                        header('Content-type: text/xml; charset=utf-8');
    112                         echo '<?xml version="1.0" encoding="utf-8" ?>';
    113                         echo "\n";
     117                        $body  = '<?xml version="1.0" encoding="utf-8" ?>';
     118                        $body .= "\n";
     119                       
    114120                        if (count($result) == 0)
    115                                 echo '<res id="' . $id . '" cmd="'. $cmd .'" />';
     121                                $body .= '<res id="' . $id . '" cmd="'. $cmd .'" />';
    116122                        else
    117                                 echo '<res id="' . $id . '" cmd="'. $cmd .'">'. utf8_encode(implode(" ", $result)) .'</res>';
     123                                $body .= '<res id="' . $id . '" cmd="'. $cmd .'">'. urlencode(implode(" ", $result)) .'</res>';
    118124
     125                        echo $body;
    119126                break;
    120127                case "xmlerror";
    121128                        header('Content-type: text/xml; charset=utf-8');
    122                         echo '<?xml version="1.0" encoding="utf-8" ?>';
    123                         echo "\n";
    124                         echo '<res id="' . $id . '" cmd="'. $cmd .'" error="true" msg="'. implode(" ", $tinyspell->errorMsg) .'" />';
     129                        $body  = '<?xml version="1.0" encoding="utf-8" ?>';
     130                        $body .= "\n";
     131                        $body .= '<res id="' . $id . '" cmd="'. $cmd .'" error="true" msg="'. implode(" ", $tinyspell->errorMsg) .'" />';
     132                        echo $body;
    125133                break;
    126134                case "html":
    … …  
    131139                break;
    132140        }
    133 ?>
     141
     142?>
Note: See TracChangeset for help on using the changeset viewer.