- Timestamp:
- Oct 17, 2008, 3:06:00 AM (16 years ago)
- Location:
- branches/2.0/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/include/common.inc.php
r2700 r2765 37 37 if( !get_magic_quotes_gpc() ) 38 38 { 39 function sanitize_mysql_kv(&$v, $k) 40 { 41 $v = addslashes($v); 42 } 39 43 if( is_array( $_GET ) ) 40 44 { 41 while( list($k, $v) = each($_GET) ) 42 { 43 if( is_array($_GET[$k]) ) 44 { 45 while( list($k2, $v2) = each($_GET[$k]) ) 46 { 47 $_GET[$k][$k2] = addslashes($v2); 48 } 49 @reset($_GET[$k]); 50 } 51 else 52 { 53 $_GET[$k] = addslashes($v); 54 } 55 } 56 @reset($_GET); 57 } 58 59 if( is_array($_POST) ) 60 { 61 while( list($k, $v) = each($_POST) ) 62 { 63 if( is_array($_POST[$k]) ) 64 { 65 while( list($k2, $v2) = each($_POST[$k]) ) 66 { 67 $_POST[$k][$k2] = addslashes($v2); 68 } 69 @reset($_POST[$k]); 70 } 71 else 72 { 73 $_POST[$k] = addslashes($v); 74 } 75 } 76 @reset($_POST); 77 } 78 79 if( is_array($_COOKIE) ) 80 { 81 while( list($k, $v) = each($_COOKIE) ) 82 { 83 if( is_array($_COOKIE[$k]) ) 84 { 85 while( list($k2, $v2) = each($_COOKIE[$k]) ) 86 { 87 $_COOKIE[$k][$k2] = addslashes($v2); 88 } 89 @reset($_COOKIE[$k]); 90 } 91 else 92 { 93 $_COOKIE[$k] = addslashes($v); 94 } 95 } 96 @reset($_COOKIE); 45 array_walk_recursive( $_GET, 'sanitize_mysql_kv' ); 46 } 47 if( is_array( $_POST ) ) 48 { 49 array_walk_recursive( $_POST, 'sanitize_mysql_kv' ); 50 } 51 if( is_array( $_COOKIE ) ) 52 { 53 array_walk_recursive( $_COOKIE, 'sanitize_mysql_kv' ); 97 54 } 98 55 } -
branches/2.0/include/ws_functions.inc.php
r2756 r2765 188 188 return new PwgError(401, 'Access denied'); 189 189 } 190 $params['image_id'] = array_map( 'intval',$params['image_id'] ); 190 191 if ( empty($params['image_id']) ) 191 192 { … … 292 293 GROUP BY i.id 293 294 '.$order_by.' 294 LIMIT '. $params['per_page']*$params['page'].','.$params['per_page'];295 LIMIT '.(int)($params['per_page']*$params['page']).','.(int)$params['per_page']; 295 296 296 297 $result = pwg_query($query); … … 684 685 WHERE '.$where_comments.' 685 686 ORDER BY date 686 LIMIT '. $params['comments_per_page']*(int)$params['comments_page'].687 ','. $params['comments_per_page'];687 LIMIT '.(int)($params['comments_per_page']*$params['comments_page']). 688 ','.(int)$params['comments_per_page']; 688 689 689 690 $result = pwg_query($query); … … 858 859 return new PwgError(401, 'Access denied'); 859 860 } 861 $params['image_id'] = array_map( 'intval',$params['image_id'] ); 860 862 if ( empty($params['image_id']) ) 861 863 { … … 1263 1265 AND ', $where_clauses).' 1264 1266 '.$order_by.' 1265 LIMIT '. $params['per_page']*$params['page'].','.$params['per_page'];1267 LIMIT '.(int)($params['per_page']*$params['page']).','.(int)$params['per_page']; 1266 1268 1267 1269 $result = pwg_query($query);
Note: See TracChangeset
for help on using the changeset viewer.