aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/functions_permalinks.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2010-06-17 18:11:11 +0000
committernikrou <nikrou@piwigo.org>2010-06-17 18:11:11 +0000
commitdbe75d113b43cae453ac5d3331157927fedd6ae7 (patch)
tree32f261b5fda06b6ac6ccb9cc8a23c706742aa36b /admin/include/functions_permalinks.php
parent5baa3409e5d3bedcdce35da97c89bd577561165c (diff)
Bug 1733 fixed : merge from trunk
single quotes in queries git-svn-id: http://piwigo.org/svn/branches/2.1@6551 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include/functions_permalinks.php')
-rw-r--r--admin/include/functions_permalinks.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/admin/include/functions_permalinks.php b/admin/include/functions_permalinks.php
index 3a613f96b..a61ed32a0 100644
--- a/admin/include/functions_permalinks.php
+++ b/admin/include/functions_permalinks.php
@@ -28,7 +28,7 @@ function get_cat_id_from_permalink( $permalink )
{
$query ='
SELECT id FROM '.CATEGORIES_TABLE.'
- WHERE permalink="'.$permalink.'"';
+ WHERE permalink=\''.$permalink.'\'';
$ids = array_from_query($query, 'id');
if (!empty($ids))
{
@@ -69,7 +69,7 @@ function delete_cat_permalink( $cat_id, $save )
$query = '
SELECT permalink
FROM '.CATEGORIES_TABLE.'
- WHERE id="'.$cat_id.'"
+ WHERE id=\''.$cat_id.'\'
;';
$result = pwg_query($query);
if ( pwg_db_num_rows($result) )
@@ -108,7 +108,7 @@ UPDATE '.CATEGORIES_TABLE.'
$query = '
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
{
@@ -116,7 +116,7 @@ UPDATE '.OLD_PERMALINKS_TABLE.'
INSERT INTO '.OLD_PERMALINKS_TABLE.'
(permalink, cat_id, date_deleted)
VALUES
- ( "'.$permalink.'",'.$cat_id.',NOW() )';
+ ( \''.$permalink.'\','.$cat_id.',NOW() )';
}
pwg_query( $query );
}
@@ -185,13 +185,13 @@ function set_cat_permalink( $cat_id, $permalink, $save )
assert( $old_cat_id==$cat_id );
$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);
}
$query = '
UPDATE '.CATEGORIES_TABLE.'
- SET permalink="'.$permalink.'"
+ SET permalink=\''.$permalink.'\'
WHERE id='.$cat_id;
// LIMIT 1';
pwg_query($query);