Changeset 1621


Ignore:
Timestamp:
Dec 1, 2006, 12:46:12 AM (17 years ago)
Author:
rvelices
Message:

bug 596: Comments can be entered on non commentable images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_6/include/picture_comment.inc.php

    r1504 r1621  
    3131 */
    3232
     33// the picture is commentable if it belongs at least to one category which
     34// is commentable
     35$page['show_comments'] = false;
     36foreach ($related_categories as $category)
     37{
     38  if ($category['commentable'] == 'true')
     39  {
     40    $page['show_comments'] = true;
     41  }
     42}
     43
    3344if ( isset( $_POST['content'] ) and !empty($_POST['content']) )
    3445{
     46  if (!$page['show_comments'])
     47  {
     48    header('HTTP/1.1 403 Forbidden');
     49    header('Status: 403 Forbidden');
     50    die('Hacking attempt!');
     51  }
     52
    3553  $register_comment = true;
    3654  $author = !empty($_POST['author'])?$_POST['author']:$lang['guest'];
     
    106124        array('INFORMATION'=>$lang['comment_anti-flood']));
    107125    }
    108   }
    109 }
    110 
    111 // the picture is commentable if it belongs at least to one category which
    112 // is commentable
    113 $page['show_comments'] = false;
    114 foreach ($related_categories as $category)
    115 {
    116   if ($category['commentable'] == 'true')
    117   {
    118     $page['show_comments'] = true;
    119126  }
    120127}
Note: See TracChangeset for help on using the changeset viewer.