Bug 1755 fixed : Needs single quotes in queries official plugins

Merge from trunk

git-svn-id: http://piwigo.org/svn/branches/2.1@6655 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou 2010-07-03 12:22:58 +00:00
parent b83df6be68
commit 6656dfb06a
5 changed files with 8 additions and 8 deletions

View file

@ -86,7 +86,7 @@ function deactivate_non_standard_plugins()
$query = ' $query = '
SELECT id SELECT id
FROM '.PREFIX_TABLE.'plugins FROM '.PREFIX_TABLE.'plugins
WHERE state = "active" WHERE state = \'active\'
AND id NOT IN (\'' . implode('\',\'', $standard_plugins) . '\') AND id NOT IN (\'' . implode('\',\'', $standard_plugins) . '\')
;'; ;';
@ -101,7 +101,7 @@ AND id NOT IN (\'' . implode('\',\'', $standard_plugins) . '\')
{ {
$query = ' $query = '
UPDATE '.PREFIX_TABLE.'plugins UPDATE '.PREFIX_TABLE.'plugins
SET state="inactive" SET state=\'inactive\'
WHERE id IN (\'' . implode('\',\'', $plugins) . '\') WHERE id IN (\'' . implode('\',\'', $plugins) . '\')
;'; ;';
pwg_query($query); pwg_query($query);

View file

@ -431,7 +431,7 @@ SELECT id, permalink, 0 AS is_old
{ {
$query=' $query='
UPDATE '.OLD_PERMALINKS_TABLE.' SET last_hit=NOW(), hit=hit+1 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'; LIMIT 1';
pwg_query($query); pwg_query($query);
} }

View file

@ -52,9 +52,9 @@ SELECT id, file, level
else else
{// url given by file name {// url given by file name
assert( !empty($page['image_file']) ); assert( !empty($page['image_file']) );
$query .= 'file LIKE "' . $query .= 'file LIKE \'' .
str_replace(array('_','%'), array('/_','/%'), $page['image_file'] ). str_replace(array('_','%'), array('/_','/%'), $page['image_file'] ).
'.%" ESCAPE "/" LIMIT 1'; '.%\' ESCAPE \'/\' LIMIT 1';
} }
if ( ! ( $row = pwg_db_fetch_assoc(pwg_query($query)) ) ) if ( ! ( $row = pwg_db_fetch_assoc(pwg_query($query)) ) )
{// element does not exist {// element does not exist

View file

@ -27,7 +27,7 @@ function plugin_install()
$query = ' $query = '
INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
VALUES ("LocalFilesEditor" , "off" , "LocalFiles Editor plugin parameters");'; VALUES (\'LocalFilesEditor\' , \'off\' , \'LocalFiles Editor plugin parameters\');';
pwg_query($query); pwg_query($query);
} }
@ -36,7 +36,7 @@ function plugin_uninstall()
{ {
global $prefixeTable; 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); pwg_query($query);
} }

View file

@ -47,7 +47,7 @@ where
group by group by
upper('.$conf['user_fields']['email'].') upper('.$conf['user_fields']['email'].')
having count(*) > 1 having count(*) > 1
limit 0,1 limit 1
;'; ;';
if (pwg_db_fetch_row(pwg_query($query))) if (pwg_db_fetch_row(pwg_query($query)))