Opened 11 years ago

Closed 11 years ago

#11354 closed Bug Report - General (Fixed)

Newlines in file.subtitle in recorded.php cause Javascript error (patch)

Reported by: Martin van Es <martin@…> 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)

mythweb.diff (811 bytes) - added by bas-t@… 11 years ago.
The needed diff, according to Martin van Es

Download all attachments as: .zip

Change History (2)

Changed 11 years ago by bas-t@…

Attachment: mythweb.diff added

The needed diff, according to Martin van Es

comment:1 Changed 11 years ago by Rob Smith

Resolution: Fixed
Status: newclosed
Note: See TracTickets for help on using tickets.