Title: [opsview-base] [336] encode HTML entities in json responses in getObjectStates ajax handler
Revision
336
Author
aburzynski
Date
2013-08-12 11:59:55 +0100 (Mon, 12 Aug 2013)

Log Message

encode HTML entities in json responses in getObjectStates ajax handler

Modified Paths

Added Paths

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2013-08-08 15:51:44 UTC (rev 335)
+++ trunk/Makefile	2013-08-12 10:59:55 UTC (rev 336)
@@ -946,6 +946,7 @@
 	cd ${NAGVIS} && patch -p1 < ../patches/nagvis_remove_deprecated_display_errors.patch
 	cd ${NAGVIS} && patch -p1 < ../patches/nagvis_config_url_target.patch
 	cd ${NAGVIS} && patch -p1 < ../patches/nagvis_msie10.patch
+	cd ${NAGVIS} && patch -p1 < ../patches/nagvis_htmlentities.patch
 	# TODO update patches that work but with some fuzz
 	find ${NAGVIS} -name "*.orig" -exec rm {} \;
 	cp patches/nagvis/opsview.cfg ${NAGVIS}/etc/maps/

Added: trunk/patches/nagvis_htmlentities.patch
===================================================================
--- trunk/patches/nagvis_htmlentities.patch	                        (rev 0)
+++ trunk/patches/nagvis_htmlentities.patch	2013-08-12 10:59:55 UTC (rev 336)
@@ -0,0 +1,18 @@
+diff -ur nagvis-1.4.4/nagvis/ajax_handler.php nagvis-1.4.4.htmlentities//nagvis/ajax_handler.php
+--- nagvis-1.4.4/nagvis/ajax_handler.php	2009-10-15 17:41:24.000000000 +0100
++++ nagvis-1.4.4.htmlentities//nagvis/ajax_handler.php	2013-08-12 11:48:30.000000000 +0100
+@@ -156,6 +156,14 @@
+ 				
+ 				$arrReturn[] = $arr;
+ 			}
++
++            array_walk_recursive( $arrReturn,
++                function( &$val, $key ) {
++                    if( is_string($val) ) {
++                        $val = htmlentities($val);
++                    }
++                }
++            );
+ 			
+ 			echo json_encode($arrReturn);
+ 		}

_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to