Changeset 3487 for trunk/comments.php


Ignore:
Timestamp:
Jul 1, 2009, 10:43:20 PM (15 years ago)
Author:
rvelices
Message:
  • remove unnecessary addslashes in comments.cpp
  • in template use modifier |@default instead of |default (generated code is faster because we indicate that the input is scalar and not an array)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/comments.php

    r3452 r3487  
    101101if (isset($_GET['author']) and !empty($_GET['author']))
    102102{
    103   $page['where_clauses'][] = 
    104     'u.'.$conf['user_fields']['username'].' = \''.addslashes($_GET['author']).'\'
    105      OR author = \''.addslashes($_GET['author']).'\'';   
     103  $page['where_clauses'][] =
     104    'u.'.$conf['user_fields']['username'].' = \''.$_GET['author'].'\'
     105     OR author = \''.$_GET['author'].'\'';
    106106}
    107107
     
    167167    and (is_admin() || $conf['user_can_edit_comment']))
    168168{
    169   if (!empty($_POST['content'])) 
     169  if (!empty($_POST['content']))
    170170  {
    171     update_user_comment(array('comment_id' => $_GET['edit'], 
     171    update_user_comment(array('comment_id' => $_GET['edit'],
    172172                              'image_id' => $_POST['image_id'],
    173173                              'content' => $_POST['content']),
    174174                        $_POST['key']
    175                         ); 
     175                        );
    176176
    177177    $edit_comment = null;
    178178  }
    179   else 
     179  else
    180180  {
    181181    $edit_comment = $_GET['edit'];
     
    306306     , com.validated
    307307  FROM '.IMAGE_CATEGORY_TABLE.' AS ic
    308     INNER JOIN '.COMMENTS_TABLE.' AS com   
     308    INNER JOIN '.COMMENTS_TABLE.' AS com
    309309    ON ic.image_id = com.image_id
    310310    LEFT JOIN '.USERS_TABLE.' AS u
     
    375375          );
    376376
    377     if (!empty($comment['author'])) 
     377    if (!empty($comment['author']))
    378378    {
    379379      $author = $comment['author'];
     
    398398        );
    399399
    400     if (can_manage_comment('delete', $comment['author_id'])) 
     400    if (can_manage_comment('delete', $comment['author_id']))
    401401    {
    402402      $url = get_root_url().'comments.php'
    403403        .get_query_string_diff(array('delete','validate','edit'));
    404       $tpl_comment['U_DELETE'] = 
     404      $tpl_comment['U_DELETE'] =
    405405        add_url_params($url,
    406406                       array('delete'=>$comment['comment_id'])
     
    411411      $url = get_root_url().'comments.php'
    412412        .get_query_string_diff(array('edit', 'delete','validate'));
    413       $tpl_comment['U_EDIT'] = 
     413      $tpl_comment['U_EDIT'] =
    414414        add_url_params($url,
    415415                       array('edit'=>$comment['comment_id'])
    416416                       );
    417       if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment)) 
     417      if (isset($edit_comment) and ($comment['comment_id'] == $edit_comment))
    418418      {
    419419        $tpl_comment['IN_EDIT'] = true;
     
    427427    if ( is_admin() && $comment['validated'] != 'true')
    428428    {
    429       $tpl_comment['U_VALIDATE'] = 
     429      $tpl_comment['U_VALIDATE'] =
    430430        add_url_params($url,
    431431                       array('validate'=>$comment['comment_id'])
Note: See TracChangeset for help on using the changeset viewer.