Revision: 1104
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1104&view=rev
Author:   cimorrison
Date:     2009-04-29 23:16:16 +0000 (Wed, 29 Apr 2009)

Log Message:
-----------
Added escaping of the backslash character in room name.   This fixes a bug that 
meant that when JavaScript was enabled room names with backslashes were not 
being displayed properly in the room select on the edit entry form.   In 
extreme cases (if the room name ended with a backslash) the area select would 
not appear at all because the unescaped backslash was causing an unterminated 
string literal.

Modified Paths:
--------------
    mrbs/trunk/web/edit_entry.php

Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php       2009-04-29 22:13:43 UTC (rev 1103)
+++ mrbs/trunk/web/edit_entry.php       2009-04-29 23:16:16 UTC (rev 1104)
@@ -607,7 +607,9 @@
               {
                 for ($j = 0; ($row2 = sql_row_keyed($res2, $j)); $j++)
                 {
-                  print "        roomsObj.options[$j] = new 
Option(\"".str_replace('"','\\"',$row2['room_name'])."\",".$row2['id'] .");\n";
+                  $clean_room_name = str_replace('\\', '\\\\', 
$row2['room_name']);
+                  $clean_room_name = str_replace('"', '\\"', $clean_room_name);
+                  print "        roomsObj.options[$j] = new 
Option(\"".$clean_room_name."\",".$row2['id'] .");\n";
                 }
                 // select the first entry by default to ensure
                 // that one room is selected to begin with


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to