Changeset 84


Ignore:
Timestamp:
Sep 9, 2003, 8:36:25 PM (21 years ago)
Author:
z0rglub
Message:

Security improve : you can't display a picture in a category it doesn't
belong to

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r78 r84  
    3737//-------------------------------------------------------------- initialization
    3838initialize_category( 'picture' );
    39 $cat_directory = $page['cat_dir']; // by default
    4039//------------------------------------- main picture information initialization
    4140$query = 'SELECT id,date_available,comment,hit,keywords';
     
    5352$query.= ';';
    5453$result = mysql_query( $query );
     54// if this image_id doesn't correspond to this category, an error message is
     55// displayed, and execution is stopped
     56if ( mysql_num_rows( $result ) == 0 )
     57{
     58  echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />';
     59  echo '<a href="'.add_session_id( './category.php' ).'">';
     60  echo $lang['thumbnails'].'</a></div>';
     61  exit();
     62}
    5563$row = mysql_fetch_array( $result );
    5664$page['id']             = $row['id'];
Note: See TracChangeset for help on using the changeset viewer.