Ignore:
Timestamp:
Mar 19, 2010, 11:25:39 PM (14 years ago)
Author:
plg
Message:

bug 1328: backport the pwg_token on trunk

bug 1329: backport the check_input_parameter on trunk

feature 1026: add pwg_token feature for edit/delete comment. Heavy refactoring
on this feature to make the code simpler and easier to maintain (I hope).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/picture_comment.inc.php

    r5021 r5195  
    167167      if (can_manage_comment('delete', $row['author_id']))
    168168      {
    169         $tpl_comment['U_DELETE'] =
    170           add_url_params($url_self,
    171                          array(
    172                            'action'=>'delete_comment',
    173                            'comment_to_delete'=>$row['id']
    174                                )
    175                          );
     169        $tpl_comment['U_DELETE'] = add_url_params(
     170          $url_self,
     171          array(
     172            'action'=>'delete_comment',
     173            'comment_to_delete'=>$row['id'],
     174            'pwg_token' => get_pwg_token(),
     175            )
     176          );
    176177      }
    177178      if (can_manage_comment('edit', $row['author_id']))
    178179      {
    179         $tpl_comment['U_EDIT'] =
    180           add_url_params($url_self,
    181                          array(
    182                            'action'=>'edit_comment',
    183                            'comment_to_edit'=>$row['id']
    184                                )
    185                          );
     180        $tpl_comment['U_EDIT'] = add_url_params(
     181          $url_self,
     182          array(
     183            'action'=>'edit_comment',
     184            'comment_to_edit'=>$row['id'],
     185            'pwg_token' => get_pwg_token(),
     186            )
     187          );
    186188        if (isset($edit_comment) and ($row['id'] == $edit_comment))
    187189        {
     
    196198        if ($row['validated'] != 'true')
    197199        {
    198           $tpl_comment['U_VALIDATE'] =
    199             add_url_params($url_self,
    200                            array('action' => 'validate_comment',
    201                                  'comment_to_validate' => $row['id']
    202                                  )
    203                            );
     200          $tpl_comment['U_VALIDATE'] = add_url_params(
     201            $url_self,
     202            array(
     203              'action' => 'validate_comment',
     204              'comment_to_validate' => $row['id'],
     205              'pwg_token' => get_pwg_token(),
     206              )
     207            );
    204208        }
    205209      }
Note: See TracChangeset for help on using the changeset viewer.