Changeset 2405
- Timestamp:
- 04/01/10 15:44:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/expressoMail1_2/corretor_ortografico/spell_checker/spell_checker.php
r2387 r2405 40 40 // User-configurable list of allowed HTML tags and attributes. 41 41 // Thanks to Jake Olefsky for this little addition 42 $allowed_html = '<strong><small><p><br><a><b><u><i><img><code><ul><ol><li>'; 42 //$allowed_html = '<strong><small><p><br><a><b><u><i><img><code><ul><ol><li>'; //Removed. Accept alll HTML tags. 43 43 44 44 // Set the max number of suggestions to return at a time. 45 define('MAX_SUGGESTIONS', 10);45 define('MAX_SUGGESTIONS', 3); 46 46 47 47 // Set whether to use a personal dictionary. 48 $usePersonalDict = true;48 $usePersonalDict = false; 49 49 50 50 //Set whether users are allowed to update the personal dictionary. 51 $editablePersonalDict = true;51 $editablePersonalDict = false; 52 52 53 53 // If using a personal dictionary, set the path to it. Default is in the … … 161 161 $retVal = ""; 162 162 163 //$string = stripslashes_custom($string); //we only need to strip slashes if magic quotes are on164 165 $string = remove_word_junk($string); 166 167 163 $string = stripslashes_custom($string); //we only need to strip slashes if magic quotes are on 164 165 $string = remove_word_junk($string); 166 167 //make all the returns in the text look the same 168 168 $string = preg_replace("/\r?\n/", "\n", $string); 169 169 … … 199 199 { 200 200 $onClick = "onclick=\"setCurrentObject(" . $varName . "); showSuggestions('" . addslashes($tmpWord) . "', '" . $varName . "_" . $misspelledCount . "_" . addslashes($tmpWord) . "'); return false;\""; 201 $words[$i][$j] = str_replace($tmpWord, "<span " . $onClick . " id=\"" . $varName . "_" . $misspelledCount . "_" . $tmpWord . "\" class=\"highlight\">" . stripslashes($tmpWord) . " </span>", $words[$i][$j]);201 $words[$i][$j] = str_replace($tmpWord, "<span " . $onClick . " id=\"" . $varName . "_" . $misspelledCount . "_" . $tmpWord . "\" class=\"highlight\">" . stripslashes($tmpWord) . " </span>", $words[$i][$j]); 202 202 $misspelledCount++; 203 203 } … … 233 233 // Concatenate all the words/tags/etc. back into a string and append it to the result. 234 234 $string .= implode('', $words); 235 236 //remove comments from around all html tags except for <a> because we don't want the links to be clickable 235 236 $string = preg_replace("/<!--</i", "<", $string); //Retira os comentários das tags HTML 237 $string = preg_replace("/>-->/i", ">", $string); 238 239 ////Function Removed from the original. Accept alll HTML tags. 240 //remove comments from around all html tags except for <a> because we don't want the links to be clickable 237 241 //but we want the html to be rendered in the div for preview purposes. 238 $string = preg_replace("/<!--<br( [^>]*)?>-->/i", "<br />", $string);242 /*$string = preg_replace("/<!--<br( [^>]*)?>-->/i", "<br />", $string); 239 243 $string = preg_replace("/<!--<p( [^>]*)?>-->/i", "<p>", $string); 240 244 $string = preg_replace("/<!--<\/p>-->/i", "</p>", $string); … … 252 256 $string = preg_replace("/<!--<\/li>-->/i", "</li>", $string); 253 257 $string = preg_replace("/<!--<img (?:[^>]+ )?src=\"?([^\"]*)\"?[^>]*>-->/i", "<img src=\"\\1\" />", $string); 254 258 <<<<<<< .mine 259 260 $string = preg_replace("/<!--<table( [^>]*)?>-->/i", "<table border=\"\\\" >", $string); 261 $string = preg_replace("/<!--<\/table>-->/i", "</table>", $string); 262 $string = preg_replace("/<!--<td( [^>]*)?>-->/i", "<td>", $string); 263 $string = preg_replace("/<!--<\/td>-->/i", "</td>", $string); 264 $string = preg_replace("/<!--<tbody( [^>]*)?>-->/i", "<tbody>", $string); 265 $string = preg_replace("/<!--<\/tbody>-->/i", "</tbody>", $string); 266 $string = preg_replace("/<!--<tr( [^>]*)?>-->/i", "<tr>", $string); 267 $string = preg_replace("/<!--<\/tr>-->/i", "</tr>", $string);*/ 268 255 269 $cp->set_data(utf8_encode($string)); //return value - string containing all the markup for the misspelled words. 256 270 … … 431 445 $string = preg_replace("/\r?\n/", " ", $string); 432 446 $string = stripslashes_custom($string); //we only need to strip slashes if magic quotes are on 433 $string = strip_tags($string, $allowed_html);447 //$string = strip_tags($string, $allowed_html); //Removed. Accept all HTML tags. 434 448 $string = preg_replace('{</?span.*?>}i', '', $string); 435 $string = html_entity_decode($string); 449 $string = html_entity_decode($string); 450 436 451 $cp->set_data($string); //the return value 452 437 453 438 454 } // end switchText
Note: See TracChangeset
for help on using the changeset viewer.