Quote:
Originally Posted by LunaTech
Line 47, 48, and 49 should look like (note, I've replaced the HEX 0D character, the line break, in with a space so it displays right on this page):
Code:
// can't have newlines or carriage returns in javascript string
$mystr = str_replace(" ", "", $mystr);
$mystr = str_replace("\n", "_|_", $mystr);
Not:
Code:
// can't have newlines or carriage returns in javascript string
$mystr = str_replace("
", "", $mystr);
$mystr = str_replace("\n", "_|_", $mystr);
The problem is most editors won't read it right. I had to use UltraEdit32, in UNIX mode. To see if you're having the same problem as I did, try spell checking a single line of text with no line breaks. Just like 3 words. If that works fine but more text doesn't - that's probably the problem.
|
Good catch!
For me this fixed the "Error:Unterminated string constant" problem of messages with linebreaks:
edit checkspelling.php, find:
PHP Code:
$mystr = stripslashes($_POST['spellstring']);
// can't have newlines or carriage returns in javascript string
$mystr = str_replace(" ", "", $mystr);
$mystr = str_replace("\n", "_|_", $mystr);
replace it as:
PHP Code:
$mystr = stripslashes($_POST['spellstring']);
// can't have newlines or carriage returns in javascript string
$mystr = str_replace("\r", "", $mystr);
$mystr = str_replace("\n", "_|_", $mystr);