Index: /branches/2.1/admin/cat_modify.php
===================================================================
--- /branches/2.1/admin/cat_modify.php	(revision 6550)
+++ /branches/2.1/admin/cat_modify.php	(revision 6551)
@@ -93,6 +93,6 @@
   {
     $query = '
-UPDATE '.CATEGORIES_TABLE.' SET image_order='.(isset($image_order) ? 'NULL':"'$image_order'").'
-  WHERE uppercats LIKE "'.$cat_info['uppercats'].',%"';
+UPDATE '.CATEGORIES_TABLE.' SET image_order='.(isset($image_order) ? 'NULL':'\''.$image_order.'\'').'
+  WHERE uppercats LIKE \''.$cat_info['uppercats'].',%\'';
     pwg_query($query);
   }
Index: /branches/2.1/admin/extend_for_templates.php
===================================================================
--- /branches/2.1/admin/extend_for_templates.php	(revision 6550)
+++ /branches/2.1/admin/extend_for_templates.php	(revision 6551)
@@ -140,8 +140,8 @@
   $tpl_extension = $replacements;
   /* ecrire la nouvelle conf */
-  $query = "
-UPDATE ".CONFIG_TABLE."
-  SET value = '". $conf['extents_for_templates'] ."'
-WHERE param = 'extents_for_templates';";
+  $query = '
+UPDATE '.CONFIG_TABLE.'
+  SET value = \''. $conf['extents_for_templates'] .'\'
+WHERE param = \'extents_for_templates\';';
   if (pwg_query($query))
   {
Index: /branches/2.1/admin/include/functions_permalinks.php
===================================================================
--- /branches/2.1/admin/include/functions_permalinks.php	(revision 6550)
+++ /branches/2.1/admin/include/functions_permalinks.php	(revision 6551)
@@ -29,5 +29,5 @@
   $query ='
 SELECT id FROM '.CATEGORIES_TABLE.'
-  WHERE permalink="'.$permalink.'"';
+  WHERE permalink=\''.$permalink.'\'';
   $ids = array_from_query($query, 'id');
   if (!empty($ids))
@@ -70,5 +70,5 @@
 SELECT permalink
   FROM '.CATEGORIES_TABLE.'
-  WHERE id="'.$cat_id.'"
+  WHERE id=\''.$cat_id.'\'
 ;';
   $result = pwg_query($query);
@@ -109,5 +109,5 @@
 UPDATE '.OLD_PERMALINKS_TABLE.'
   SET date_deleted=NOW()
-  WHERE cat_id='.$cat_id.' AND permalink="'.$permalink.'"';
+  WHERE cat_id='.$cat_id.' AND permalink=\''.$permalink.'\'';
     }
     else
@@ -117,5 +117,5 @@
   (permalink, cat_id, date_deleted)
 VALUES
-  ( "'.$permalink.'",'.$cat_id.',NOW() )';
+  ( \''.$permalink.'\','.$cat_id.',NOW() )';
     }
     pwg_query( $query );
@@ -186,5 +186,5 @@
     $query = '
 DELETE FROM '.OLD_PERMALINKS_TABLE.'
-  WHERE cat_id='.$old_cat_id.' AND permalink="'.$permalink.'"';
+  WHERE cat_id='.$old_cat_id.' AND permalink=\''.$permalink.'\'';
     pwg_query($query);
   }
@@ -192,5 +192,5 @@
   $query = '
 UPDATE '.CATEGORIES_TABLE.'
-  SET permalink="'.$permalink.'"
+  SET permalink=\''.$permalink.'\'
   WHERE id='.$cat_id;
   //  LIMIT 1';
Index: /branches/2.1/admin/include/functions_upgrade.php
===================================================================
--- /branches/2.1/admin/include/functions_upgrade.php	(revision 6550)
+++ /branches/2.1/admin/include/functions_upgrade.php	(revision 6551)
@@ -88,5 +88,5 @@
 FROM '.PREFIX_TABLE.'plugins
 WHERE state = "active"
-AND id NOT IN ("' . implode('","', $standard_plugins) . '")
+AND id NOT IN (\'' . implode('\',\'', $standard_plugins) . '\')
 ;';
 
@@ -103,5 +103,5 @@
 UPDATE '.PREFIX_TABLE.'plugins
 SET state="inactive"
-WHERE id IN ("' . implode('","', $plugins) . '")
+WHERE id IN (\'' . implode('\',\'', $plugins) . '\')
 ;';
     pwg_query($query);
@@ -163,5 +163,5 @@
 SELECT password, status
 FROM '.USERS_TABLE.'
-WHERE username = "'.$username.'"
+WHERE username = \''.$username.'\'
 ;';
   }
@@ -173,5 +173,5 @@
 INNER JOIN '.USER_INFOS_TABLE.' AS ui
 ON u.'.$conf['user_fields']['id'].'=ui.user_id
-WHERE '.$conf['user_fields']['username'].'="'.$username.'"
+WHERE '.$conf['user_fields']['username'].'=\''.$username.'\'
 ;';
   }
Index: /branches/2.1/admin/include/languages.class.php
===================================================================
--- /branches/2.1/admin/include/languages.class.php	(revision 6550)
+++ /branches/2.1/admin/include/languages.class.php	(revision 6551)
@@ -100,9 +100,9 @@
         }
 
-        $query = "
+        $query = '
 DELETE
-  FROM ".LANGUAGES_TABLE."
-  WHERE id= '".$language_id."'
-;";
+  FROM '.LANGUAGES_TABLE.'
+  WHERE id= \''.$language_id.'\'
+;';
         pwg_query($query);
         break;
@@ -123,6 +123,6 @@
         $query = '
 UPDATE '.USER_INFOS_TABLE.'
-  SET language = "'.get_default_language().'"
-  WHERE language = "'.$language_id.'"
+  SET language = \''.get_default_language().'\'
+  WHERE language = \''.$language_id.'\'
 ;';
         pwg_query($query);
@@ -137,5 +137,5 @@
         $query = '
 UPDATE '.USER_INFOS_TABLE.'
-  SET language = "'.$language_id.'"
+  SET language = \''.$language_id.'\'
   WHERE user_id = '.$conf['default_user_id'].'
 ;';
Index: /branches/2.1/admin/include/themes.class.php
===================================================================
--- /branches/2.1/admin/include/themes.class.php	(revision 6550)
+++ /branches/2.1/admin/include/themes.class.php	(revision 6551)
@@ -176,9 +176,9 @@
         }
 
-        $query = "
+        $query = '
 DELETE
-  FROM ".THEMES_TABLE."
-  WHERE id= '".$theme_id."'
-;";
+  FROM '.THEMES_TABLE.'
+  WHERE id= \''.$theme_id.'\'
+;';
         pwg_query($query);
         break;
@@ -301,5 +301,5 @@
     if (!empty($id))
     {
-      $clauses[] = "id = '".$id."'";
+      $clauses[] = 'id = \''.$id.'\'';
     }
     if (count($clauses) > 0)
Index: /branches/2.1/admin/languages_installed.php
===================================================================
--- /branches/2.1/admin/languages_installed.php	(revision 6550)
+++ /branches/2.1/admin/languages_installed.php	(revision 6551)
@@ -115,14 +115,14 @@
   $query = '
 UPDATE '.USER_INFOS_TABLE.'
-  SET language = "'.get_default_language().'"
-  WHERE language = "'.$language_id.'"
+  SET language = \''.get_default_language().'\'
+  WHERE language = \''.$language_id.'\'
 ;';
   pwg_query($query);
 
-  $query = "
+  $query = '
 DELETE
-  FROM ".LANGUAGES_TABLE."
-  WHERE id= '".$language_id."'
-;";
+  FROM '.LANGUAGES_TABLE.'
+  WHERE id= \''.$language_id.'\'
+;';
   pwg_query($query);
 }
Index: /branches/2.1/admin/permalinks.php
===================================================================
--- /branches/2.1/admin/permalinks.php	(revision 6550)
+++ /branches/2.1/admin/permalinks.php	(revision 6551)
@@ -97,5 +97,5 @@
   $query = '
 DELETE FROM '.OLD_PERMALINKS_TABLE.'
-  WHERE permalink="'.$_GET['delete_permanent'].'"
+  WHERE permalink=\''.$_GET['delete_permanent'].'\'
   LIMIT 1';
   $result = pwg_query($query);
Index: /branches/2.1/admin/thumbnail.php
===================================================================
--- /branches/2.1/admin/thumbnail.php	(revision 6550)
+++ /branches/2.1/admin/thumbnail.php	(revision 6551)
@@ -184,5 +184,5 @@
 $query = '
 SELECT galleries_url FROM '.SITES_TABLE.'
-  WHERE galleries_url NOT LIKE "http://%"
+  WHERE galleries_url NOT LIKE \'http://%\'
 ;';
 $result = pwg_query($query);
