Changeset 5003


Ignore:
Timestamp:
Feb 28, 2010, 9:58:45 PM (11 years ago)
Author:
plg
Message:

improvement: avoid the use of @ instead of a real test

Location:
branches/2.0
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/admin/cat_list.php

    r4505 r5003  
    7070// +-----------------------------------------------------------------------+
    7171
    72 check_input_parameter('parent_id', @$_GET['parent_id'], false, PATTERN_ID);
     72check_input_parameter('parent_id', $_GET, false, PATTERN_ID);
    7373
    7474$categories = array();
  • branches/2.0/admin/element_set.php

    r4495 r5003  
    4040check_status(ACCESS_ADMINISTRATOR);
    4141
    42 check_input_parameter('selection', @$_POST['selection'], true, PATTERN_ID);
     42check_input_parameter('selection', $_POST, true, PATTERN_ID);
    4343
    4444// +-----------------------------------------------------------------------+
  • branches/2.0/admin/element_set_global.php

    r4730 r5003  
    4545
    4646// the $_POST['selection'] was already checked in element_set.php
    47 check_input_parameter('add_tags', @$_POST['add_tags'], true, PATTERN_ID);
    48 check_input_parameter('del_tags', @$_POST['del_tags'], true, PATTERN_ID);
    49 check_input_parameter('associate', @$_POST['associate'], false, PATTERN_ID);
    50 check_input_parameter('dissociate', @$_POST['dissociate'], false, PATTERN_ID);
     47check_input_parameter('add_tags', $_POST, true, PATTERN_ID);
     48check_input_parameter('del_tags', $_POST, true, PATTERN_ID);
     49check_input_parameter('associate', $_POST, false, PATTERN_ID);
     50check_input_parameter('dissociate', $_POST, false, PATTERN_ID);
    5151
    5252if (isset($_POST['delete']))
  • branches/2.0/admin/picture_modify.php

    r4495 r5003  
    3434check_status(ACCESS_ADMINISTRATOR);
    3535
    36 check_input_parameter('image_id', $_GET['image_id'], false, PATTERN_ID);
    37 check_input_parameter('cat_id', @$_GET['cat_id'], false, PATTERN_ID);
     36check_input_parameter('image_id', $_GET, false, PATTERN_ID);
     37check_input_parameter('cat_id', $_GET, false, PATTERN_ID);
    3838
    3939// +-----------------------------------------------------------------------+
  • branches/2.0/comments.php

    r4508 r5003  
    118118if (!empty($_GET['comment_id']))
    119119{
    120   check_input_parameter('comment_id', $_GET['comment_id'], false, PATTERN_ID);
     120  check_input_parameter('comment_id', $_GET, false, PATTERN_ID);
    121121
    122122  // currently, the $_GET['comment_id'] is only used by admins from email
     
    184184    if (isset($_GET['delete']))
    185185    {
    186       check_input_parameter('delete', $_GET['delete'], false, PATTERN_ID);
     186      check_input_parameter('delete', $_GET, false, PATTERN_ID);
    187187     
    188188      $query = '
     
    196196    if (isset($_GET['validate']))
    197197    {
    198       check_input_parameter('validate', $_GET['validate'], false, PATTERN_ID);
     198      check_input_parameter('validate', $_GET, false, PATTERN_ID);
    199199     
    200200      $query = '
  • branches/2.0/feed.php

    r5001 r5003  
    6464// +-----------------------------------------------------------------------+
    6565
    66 check_input_parameter('feed', @$_GET['feed'], false, '/^[0-9a-z]{50}$/i');
     66check_input_parameter('feed', $_GET, false, '/^[0-9a-z]{50}$/i');
    6767
    6868$feed_id= isset($_GET['feed']) ? $_GET['feed'] : '';
  • branches/2.0/include/functions.inc.php

    r4965 r5003  
    15041504 *
    15051505 * @param string param_name
    1506  * @param mixed param_value
     1506 * @param array param_array
    15071507 * @param boolean is_array
    15081508 * @param string pattern
     
    15101510 * @return void
    15111511 */
    1512 function check_input_parameter($param_name, $param_value, $is_array, $pattern)
    1513 {
     1512function check_input_parameter($param_name, $param_array, $is_array, $pattern)
     1513{
     1514  $param_value = null;
     1515  if (isset($param_array[$param_name]))
     1516  {
     1517    $param_value = $param_array[$param_name];
     1518  }
     1519 
    15141520  // it's ok if the input parameter is null
    15151521  if (empty($param_value))
  • branches/2.0/search.php

    r4752 r5003  
    7272  if (isset($_POST['tags']))
    7373  {
    74     check_input_parameter('tags', $_POST['tags'], true, PATTERN_ID);
     74    check_input_parameter('tags', $_POST, true, PATTERN_ID);
    7575   
    7676    $search['fields']['tags'] = array(
     
    9393  if (isset($_POST['cat']))
    9494  {
    95     check_input_parameter('cat', $_POST['cat'], true, PATTERN_ID);
     95    check_input_parameter('cat', $_POST, true, PATTERN_ID);
    9696   
    9797    $search['fields']['cat'] = array(
Note: See TracChangeset for help on using the changeset viewer.