Changeset 3487


Ignore:
Timestamp:
Jul 1, 2009, 10:43:20 PM (12 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)
Location:
trunk
Files:
2 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'])
  • trunk/template/yoga/comment_list.tpl

    r3452 r3487  
    4343        <fieldset>
    4444          <legend>{'Edit a comment'|@translate}</legend>
    45           <label>{'comment'|@translate}<textarea name="content" id="contenteditid" rows="5" cols="80">{$comment.CONTENT|escape}</textarea></label>
     45          <label>{'comment'|@translate}<textarea name="content" id="contenteditid" rows="5" cols="80">{$comment.CONTENT|@escape}</textarea></label>
    4646          <input type="hidden" name="key" value="{$comment.KEY}">
    47           <input type="hidden" name="image_id" value="{$comment.IMAGE_ID|default:$current.id}">
     47          <input type="hidden" name="image_id" value="{$comment.IMAGE_ID|@default:$current.id}">
    4848          <input class="submit" type="submit" value="{'Submit'|@translate}">
    4949        </fieldset>
Note: See TracChangeset for help on using the changeset viewer.