Skip to content

Commit

Permalink
Bug 1755 : Needs single quotes in queries official plugins
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@6654 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
nikrou committed Jul 3, 2010
1 parent dd95552 commit 267c1c6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions admin/include/functions_upgrade.php
Expand Up @@ -86,7 +86,7 @@ function deactivate_non_standard_plugins()
$query = '
SELECT id
FROM '.PREFIX_TABLE.'plugins
WHERE state = "active"
WHERE state = \'active\'
AND id NOT IN (\'' . implode('\',\'', $standard_plugins) . '\')
;';

Expand All @@ -101,7 +101,7 @@ function deactivate_non_standard_plugins()
{
$query = '
UPDATE '.PREFIX_TABLE.'plugins
SET state="inactive"
SET state=\'inactive\'
WHERE id IN (\'' . implode('\',\'', $plugins) . '\')
;';
pwg_query($query);
Expand Down
2 changes: 1 addition & 1 deletion include/functions_category.inc.php
Expand Up @@ -431,7 +431,7 @@ function get_cat_id_from_permalinks( $permalinks, &$idx )
{
$query='
UPDATE '.OLD_PERMALINKS_TABLE.' SET last_hit=NOW(), hit=hit+1
WHERE permalink="'.$permalinks[$i].'" AND cat_id='.$cat_id.'
WHERE permalink=\''.$permalinks[$i].'\' AND cat_id='.$cat_id.'
LIMIT 1';
pwg_query($query);
}
Expand Down
4 changes: 2 additions & 2 deletions picture.php
Expand Up @@ -52,9 +52,9 @@
else
{// url given by file name
assert( !empty($page['image_file']) );
$query .= 'file LIKE "' .
$query .= 'file LIKE \'' .
str_replace(array('_','%'), array('/_','/%'), $page['image_file'] ).
'.%" ESCAPE "/" LIMIT 1';
'.%\' ESCAPE \'/\' LIMIT 1';
}
if ( ! ( $row = pwg_db_fetch_assoc(pwg_query($query)) ) )
{// element does not exist
Expand Down
4 changes: 2 additions & 2 deletions plugins/LocalFilesEditor/maintain.inc.php
Expand Up @@ -27,7 +27,7 @@ function plugin_install()

$query = '
INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plugin parameters");';
VALUES (\'LocalFilesEditor\' , \'off\' , \'LocalFiles Editor plugin parameters\');';

pwg_query($query);
}
Expand All @@ -36,7 +36,7 @@ function plugin_uninstall()
{
global $prefixeTable;

$query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="LocalFilesEditor" LIMIT 1;';
$query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param=\'LocalFilesEditor\' LIMIT 1;';
pwg_query($query);
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/c13y_upgrade/initialize.inc.php
Expand Up @@ -47,7 +47,7 @@ function c13y_upgrade($c13y)
group by
upper('.$conf['user_fields']['email'].')
having count(*) > 1
limit 0,1
limit 1
;';

if (pwg_db_fetch_row(pwg_query($query)))
Expand Down

0 comments on commit 267c1c6

Please sign in to comment.