From 0ce41c5a6c128c980be72985b6faf9e1f53ff5b9 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Sun, 17 Oct 2010 15:55:18 +0200 Subject: Protect the ':' in title or aux string. Use StringReplace here because if ':' are characters in the title or aux string it breaks parsing of timer definition in VDRs cTimer::Parse method. The '|' will be replaced back to ':' by the cTimer::Parse() method. Fix was submitted by rofafor: see http://www.vdr-portal.de/board/thread.php?threadid=100398 --- timers.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/timers.cpp b/timers.cpp index 5dd3f6c..9c741ad 100644 --- a/timers.cpp +++ b/timers.cpp @@ -136,10 +136,25 @@ namespace vdrlive { cMutexLock lock( this ); ostringstream builder; - builder << flags << ":" << channel << ":" << ( weekdays != "-------" ? weekdays : "" ) - << ( weekdays == "-------" || day.empty() ? "" : "@" ) << day << ":" << start << ":" << stop << ":" - << priority << ":" << lifetime << ":" << title << ":" << aux; - // dsyslog("%s", builder.str().c_str()); + builder << flags << ":" + << channel << ":" + << ( weekdays != "-------" ? weekdays : "" ) + << ( weekdays == "-------" || day.empty() ? "" : "@" ) << day << ":" + << start << ":" + << stop << ":" + << priority << ":" + << lifetime << ":" + << StringReplace(title, ":", "|" ) << ":" + << StringReplace(aux, ":", "|" ); + // Use StringReplace here because if ':' are characters in the + // title or aux string it breaks parsing of timer definition + // in VDRs cTimer::Parse method. The '|' will be replaced + // back to ':' by the cTimer::Parse() method. + + // Fix was submitted by rofafor: see + // http://www.vdr-portal.de/board/thread.php?threadid=100398 + + // dsyslog("%s", builder.str().c_str()); TimerPair timerData( timer, builder.str() ); -- cgit v1.2.3