Opened 12 years ago
Closed 12 years ago
#11354 closed Bug Report - General (Fixed)
Newlines in file.subtitle in recorded.php cause Javascript error (patch)
Reported by: | Owned by: | Rob Smith | |
---|---|---|---|
Priority: | major | Milestone: | unknown |
Component: | Plugin - MythWeb | Version: | 0.26-fixes |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
When parsing mythweb/tv/recorded my (chrome and firefox) browsers throw an "Uncaught SyntaxError?: Unexpected token ILLEGAL" error on all file.subtitle strings containing newlines in the generated "Load the known shows" Javascript part. The result is I can't delete recordings.
My work-around is to encapsulate the line generating the file.subtitle string on line 300 with a string_replace and nl2br like this:
file.subtitle = '<?php echo str_replace("\n", '', nl2br(addslashes($show->subtitle))) ?>';
The nl2br replaces all newline variants to one <br />\n but the \n must disappear as well, so that's what the str_replace is for.
With this patch, the page loads succesfull and I can delete recordings again.
Attachments (1)
Change History (2)
Changed 12 years ago by
Attachment: | mythweb.diff added |
---|
The needed diff, according to Martin van Es