Changeset 6551


Ignore:
Timestamp:
06/17/10 20:11:11 (8 years ago)
Author:
nikrou
Message:

Bug 1733 fixed : merge from trunk
single quotes in queries

Location:
branches/2.1/admin
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/admin/cat_modify.php

    r6364 r6551  
    9393  { 
    9494    $query = ' 
    95 UPDATE '.CATEGORIES_TABLE.' SET image_order='.(isset($image_order) ? 'NULL':"'$image_order'").' 
    96   WHERE uppercats LIKE "'.$cat_info['uppercats'].',%"'; 
     95UPDATE '.CATEGORIES_TABLE.' SET image_order='.(isset($image_order) ? 'NULL':'\''.$image_order.'\'').' 
     96  WHERE uppercats LIKE \''.$cat_info['uppercats'].',%\''; 
    9797    pwg_query($query); 
    9898  } 
  • branches/2.1/admin/extend_for_templates.php

    r6364 r6551  
    140140  $tpl_extension = $replacements; 
    141141  /* ecrire la nouvelle conf */ 
    142   $query = " 
    143 UPDATE ".CONFIG_TABLE." 
    144   SET value = '". $conf['extents_for_templates'] ."' 
    145 WHERE param = 'extents_for_templates';"; 
     142  $query = ' 
     143UPDATE '.CONFIG_TABLE.' 
     144  SET value = \''. $conf['extents_for_templates'] .'\' 
     145WHERE param = \'extents_for_templates\';'; 
    146146  if (pwg_query($query)) 
    147147  { 
  • branches/2.1/admin/include/functions_permalinks.php

    r5207 r6551  
    2929  $query =' 
    3030SELECT id FROM '.CATEGORIES_TABLE.' 
    31   WHERE permalink="'.$permalink.'"'; 
     31  WHERE permalink=\''.$permalink.'\''; 
    3232  $ids = array_from_query($query, 'id'); 
    3333  if (!empty($ids)) 
     
    7070SELECT permalink 
    7171  FROM '.CATEGORIES_TABLE.' 
    72   WHERE id="'.$cat_id.'" 
     72  WHERE id=\''.$cat_id.'\' 
    7373;'; 
    7474  $result = pwg_query($query); 
     
    109109UPDATE '.OLD_PERMALINKS_TABLE.' 
    110110  SET date_deleted=NOW() 
    111   WHERE cat_id='.$cat_id.' AND permalink="'.$permalink.'"'; 
     111  WHERE cat_id='.$cat_id.' AND permalink=\''.$permalink.'\''; 
    112112    } 
    113113    else 
     
    117117  (permalink, cat_id, date_deleted) 
    118118VALUES 
    119   ( "'.$permalink.'",'.$cat_id.',NOW() )'; 
     119  ( \''.$permalink.'\','.$cat_id.',NOW() )'; 
    120120    } 
    121121    pwg_query( $query ); 
     
    186186    $query = ' 
    187187DELETE FROM '.OLD_PERMALINKS_TABLE.' 
    188   WHERE cat_id='.$old_cat_id.' AND permalink="'.$permalink.'"'; 
     188  WHERE cat_id='.$old_cat_id.' AND permalink=\''.$permalink.'\''; 
    189189    pwg_query($query); 
    190190  } 
     
    192192  $query = ' 
    193193UPDATE '.CATEGORIES_TABLE.' 
    194   SET permalink="'.$permalink.'" 
     194  SET permalink=\''.$permalink.'\' 
    195195  WHERE id='.$cat_id; 
    196196  //  LIMIT 1'; 
  • branches/2.1/admin/include/functions_upgrade.php

    r6131 r6551  
    8888FROM '.PREFIX_TABLE.'plugins 
    8989WHERE state = "active" 
    90 AND id NOT IN ("' . implode('","', $standard_plugins) . '") 
     90AND id NOT IN (\'' . implode('\',\'', $standard_plugins) . '\') 
    9191;'; 
    9292 
     
    103103UPDATE '.PREFIX_TABLE.'plugins 
    104104SET state="inactive" 
    105 WHERE id IN ("' . implode('","', $plugins) . '") 
     105WHERE id IN (\'' . implode('\',\'', $plugins) . '\') 
    106106;'; 
    107107    pwg_query($query); 
     
    163163SELECT password, status 
    164164FROM '.USERS_TABLE.' 
    165 WHERE username = "'.$username.'" 
     165WHERE username = \''.$username.'\' 
    166166;'; 
    167167  } 
     
    173173INNER JOIN '.USER_INFOS_TABLE.' AS ui 
    174174ON u.'.$conf['user_fields']['id'].'=ui.user_id 
    175 WHERE '.$conf['user_fields']['username'].'="'.$username.'" 
     175WHERE '.$conf['user_fields']['username'].'=\''.$username.'\' 
    176176;'; 
    177177  } 
  • branches/2.1/admin/include/languages.class.php

    r6356 r6551  
    100100        } 
    101101 
    102         $query = " 
     102        $query = ' 
    103103DELETE 
    104   FROM ".LANGUAGES_TABLE." 
    105   WHERE id= '".$language_id."' 
    106 ;"; 
     104  FROM '.LANGUAGES_TABLE.' 
     105  WHERE id= \''.$language_id.'\' 
     106;'; 
    107107        pwg_query($query); 
    108108        break; 
     
    123123        $query = ' 
    124124UPDATE '.USER_INFOS_TABLE.' 
    125   SET language = "'.get_default_language().'" 
    126   WHERE language = "'.$language_id.'" 
     125  SET language = \''.get_default_language().'\' 
     126  WHERE language = \''.$language_id.'\' 
    127127;'; 
    128128        pwg_query($query); 
     
    137137        $query = ' 
    138138UPDATE '.USER_INFOS_TABLE.' 
    139   SET language = "'.$language_id.'" 
     139  SET language = \''.$language_id.'\' 
    140140  WHERE user_id = '.$conf['default_user_id'].' 
    141141;'; 
  • branches/2.1/admin/include/themes.class.php

    r6545 r6551  
    176176        } 
    177177 
    178         $query = " 
     178        $query = ' 
    179179DELETE 
    180   FROM ".THEMES_TABLE." 
    181   WHERE id= '".$theme_id."' 
    182 ;"; 
     180  FROM '.THEMES_TABLE.' 
     181  WHERE id= \''.$theme_id.'\' 
     182;'; 
    183183        pwg_query($query); 
    184184        break; 
     
    301301    if (!empty($id)) 
    302302    { 
    303       $clauses[] = "id = '".$id."'"; 
     303      $clauses[] = 'id = \''.$id.'\''; 
    304304    } 
    305305    if (count($clauses) > 0) 
  • branches/2.1/admin/languages_installed.php

    r6364 r6551  
    115115  $query = ' 
    116116UPDATE '.USER_INFOS_TABLE.' 
    117   SET language = "'.get_default_language().'" 
    118   WHERE language = "'.$language_id.'" 
     117  SET language = \''.get_default_language().'\' 
     118  WHERE language = \''.$language_id.'\' 
    119119;'; 
    120120  pwg_query($query); 
    121121 
    122   $query = " 
     122  $query = ' 
    123123DELETE 
    124   FROM ".LANGUAGES_TABLE." 
    125   WHERE id= '".$language_id."' 
    126 ;"; 
     124  FROM '.LANGUAGES_TABLE.' 
     125  WHERE id= \''.$language_id.'\' 
     126;'; 
    127127  pwg_query($query); 
    128128} 
  • branches/2.1/admin/permalinks.php

    r6364 r6551  
    9797  $query = ' 
    9898DELETE FROM '.OLD_PERMALINKS_TABLE.' 
    99   WHERE permalink="'.$_GET['delete_permanent'].'" 
     99  WHERE permalink=\''.$_GET['delete_permanent'].'\' 
    100100  LIMIT 1'; 
    101101  $result = pwg_query($query); 
  • branches/2.1/admin/thumbnail.php

    r6364 r6551  
    184184$query = ' 
    185185SELECT galleries_url FROM '.SITES_TABLE.' 
    186   WHERE galleries_url NOT LIKE "http://%" 
     186  WHERE galleries_url NOT LIKE \'http://%\' 
    187187;'; 
    188188$result = pwg_query($query); 
Note: See TracChangeset for help on using the changeset viewer.