- Timestamp:
- 03/07/2007 04:26:26 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php
r4747 r4985 8 8 * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. 9 9 */ 10 11 // Ignore the Notice errors for now. 12 error_reporting(E_ALL ^ E_NOTICE); 10 13 11 14 require_once("config.php"); … … 31 34 // Get input parameters. 32 35 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"); 41 44 $words = array(); 42 45 … … 91 94 $result = $tinyspell->checkWords($words); 92 95 break; 96 93 97 case "suggest": 94 98 $result = $tinyspell->getSuggestion($check); 95 99 break; 100 96 101 default: 97 102 // Just use this for now. … … 110 115 case "xml": 111 116 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 114 120 if (count($result) == 0) 115 echo'<res id="' . $id . '" cmd="'. $cmd .'" />';121 $body .= '<res id="' . $id . '" cmd="'. $cmd .'" />'; 116 122 else 117 echo '<res id="' . $id . '" cmd="'. $cmd .'">'. utf8_encode(implode(" ", $result)) .'</res>';123 $body .= '<res id="' . $id . '" cmd="'. $cmd .'">'. urlencode(implode(" ", $result)) .'</res>'; 118 124 125 echo $body; 119 126 break; 120 127 case "xmlerror"; 121 128 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; 125 133 break; 126 134 case "html": … … 131 139 break; 132 140 } 133 ?> 141 142 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)