Ignore:
Timestamp:
Jul 4, 2011, 8:16:38 AM (13 years ago)
Author:
icy
Message:

Merge branch 'master' into svn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Icy_Picture_Modify/include/functions_icy_picture_modify.inc.php

    r11610 r11614  
    3333  if (!preg_match(PATTERN_ID, $image_id))
    3434  {
    35     fatal_error('[Hacking attempt] the input parameter "'.$image_id.'" is not valid');
     35    bad_request('invalid picture identifier');
    3636  }
    3737  if (!preg_match(PATTERN_ID, $user_id))
    3838  {
    39     fatal_error('[Hacking attempt] the input parameter "'.$user_id.'" is not valid');
     39    bad_request('invalid category identifier');
    4040  }
    4141
     
    5151  return ($count > 0 ? true: false);
    5252}
     53
     54/*
     55 * Check if an image does exist
     56 * @return bool
     57 * @author icy
     58 *
     59*/
     60function icy_does_image_exist($image_id)
     61{
     62  if (!preg_match(PATTERN_ID, $image_id))
     63  {
     64    bad_request('invalid picture identifier');
     65  }
     66  $query = '
     67SELECT COUNT(id)
     68  FROM '.IMAGES_TABLE.'
     69  WHERE id = '.$image_id.'
     70;';
     71  list($count) = pwg_db_fetch_row(pwg_query($query));
     72  return ($count > 0 ? true: false);
     73}
    5374?>
Note: See TracChangeset for help on using the changeset viewer.