[mythtv-commits] Ticket #11354: Newlines in file.subtitle in recorded.php cause Javascript error (patch)

MythTV noreply at mythtv.org
Mon Jan 14 19:42:37 UTC 2013


#11354: Newlines in file.subtitle in recorded.php cause Javascript error (patch)
------------------------------------------+------------------------
     Reporter:  Martin van Es <martin@…>  |      Owner:  kormoc
         Type:  Bug Report - General      |     Status:  new
     Priority:  major                     |  Milestone:  unknown
    Component:  Plugin - MythWeb          |    Version:  0.26-fixes
     Severity:  medium                    |   Keywords:
Ticket locked:  0                         |
------------------------------------------+------------------------
 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.

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/11354>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list