[mythtv-commits] Ticket #9197: subtitles contain newlines breaks recorded.php

MythTV mythtv at cvs.mythtv.org
Tue Nov 9 13:23:33 UTC 2010


#9197: subtitles contain newlines breaks recorded.php
----------------------------------+-----------------------------------------
     Reporter:  mk@…              |       Owner:  kormoc 
         Type:  defect            |      Status:  new    
     Priority:  minor             |   Milestone:  unknown
    Component:  Plugin - MythWeb  |     Version:  0.23.1 
     Severity:  medium            |    Keywords:         
Ticket locked:  0                 |  
----------------------------------+-----------------------------------------
 Sometimes my recorded programs contain a newline character in the
 subtitle.

 Example:

 INSERT INTO `recordedprogram` VALUES (1101,'2010-10-02
 23:10:00','2010-10-03 01:10:00','Ingen er fuldkommen','Amerikansk komedie
 fra 1959.\rSugar er sangerinde i et dame-orkester i forbudstidens
 USA.','Hun ved ikke, at hendes to bedste veninder i orkestret i
 virkeligheden er mænd i forklædning, på flugt fra nogle gangstere, og Joe
 og Jerry har meget svært ved at bevare kvindeligheden i samværet med
 hende. Sugar: Marilyn Monroe. Joe: Tony Curtis. Jerry: Jack Lemmon.
 Manuskript: Billy Wilder og I.A.L. Diamond. Instruktion: Billy
 Wilder.','','tvshow',0000,0,0,'',1,0,0,0,0,0,'',NULL,'','','','',0,0,1,1,1,'STEREO','','WIDESCREEN');

 The \r character is not escaped by addslashes in
 modules/tv/tmpl/default/recorded.php resulting in a newline in the
 javascript text string.

 If I change line 70 from:

  file.subtitle   = '<?php echo addslashes($show->subtitle)
 ?>';

 Into:

  file.subtitle   = '<?php echo addslashes(str_replace(array("\n","\r"), '
 ', $show->subtitle))               ?>';

 the page work correctly again.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/9197>
MythTV <http://www.mythtv.org/>
MythTV Media Center


More information about the mythtv-commits mailing list