Parcourir la source

[svn r19966] Protect sort_table_config()

Yannick Warnier il y a 16 ans
Parent
commit
cf3e4154c6
1 fichiers modifiés avec 4 ajouts et 5 suppressions
  1. 4 5
      main/inc/lib/tablesort.lib.php

+ 4 - 5
main/inc/lib/tablesort.lib.php

@@ -205,11 +205,10 @@ class TableSort
 		
 	function sort_table_config($data, $column = 0, $direction = SORT_ASC, $column_show=null, $column_order=null,$type = SORT_REGULAR)
 	{
-		if(!is_array($data) || count($data)==0)
-		{
-			return array();
-		}
-		
+        if(!is_array($data) or count($data)==0){return array();}
+        if($column != strval(intval($column))){return $data;} //probably an attack
+        if(!in_array($direction,array(SORT_ASC,SORT_DESC))){return $data;} // probably an attack
+        $compare_function = '';		
 		// Change columns sort 			 
 	 	// Here we say that the real way of how the columns are going to be order is manage by the $column_order array
 	 	if(is_array($column_order))