Revision: a38852cf8aac
Branch:   default
Author:   Pekka Klärck
Date:     Fri Jan 31 11:48:06 2014 UTC
Log:      report: Fixed handlig <, > and & in tag search.

Update issue 1634
Fixed escaping <, > and & in tag search.
http://code.google.com/p/robotframework/source/detail?r=a38852cf8aac

Modified:
 /src/robot/htmldata/rebot/report.html
 /src/robot/htmldata/rebot/util.js

=======================================
--- /src/robot/htmldata/rebot/report.html       Fri Jan 31 10:11:19 2014 UTC
+++ /src/robot/htmldata/rebot/report.html       Fri Jan 31 11:48:06 2014 UTC
@@ -490,8 +490,8 @@
       <th>Search:</th>
       <td>
         <form>
-          <input id="search-field" type="text" value="${selected}">
- <input type="submit" value="Search" onclick="tagDetailSelected($('#search-field').val())">
+          <input id="search-field" type="text" value="{{html selected}}">
+ <input type="submit" value="Search" onclick="tagDetailSelected(util.escape($('#search-field').val()))"> <input type="button" value="Clear" onclick="$('#search-field').val('')">
         </form>
       </td>
=======================================
--- /src/robot/htmldata/rebot/util.js   Fri Feb 15 13:27:42 2013 UTC
+++ /src/robot/htmldata/rebot/util.js   Fri Jan 31 11:48:06 2014 UTC
@@ -48,6 +48,10 @@
     function unescape(string) {
return string.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&');
     }
+
+    function escape(string) {
+ return string.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+    }

     function normalize(string) {
         return string.toLowerCase().replace(/ /g, '').replace(/_/g, '');
@@ -169,6 +173,7 @@
         any: any,
         contains: contains,
         last: last,
+        escape: escape,
         unescape: unescape,
         normalize: normalize,
         Matcher: Matcher,

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to