From 37f6c9744129070992f9ce3b47cd6089bb8e4b02 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 19 Oct 2018 13:46:06 +0200 Subject: [PATCH] fix SQLSTATE[42000]: Syntax error or access violation in filemanager caused by not correctly quoted empty string instead of id in extended ACL --- api/src/Vfs/Sqlfs/StreamWrapper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Vfs/Sqlfs/StreamWrapper.php b/api/src/Vfs/Sqlfs/StreamWrapper.php index f266ddbeac..a9ae163b10 100644 --- a/api/src/Vfs/Sqlfs/StreamWrapper.php +++ b/api/src/Vfs/Sqlfs/StreamWrapper.php @@ -1625,7 +1625,7 @@ GROUP BY A.fs_id'; } } // now search via the database - if (count($ids) > 1) array_map(function(&$v) { $v = (int)$v; },$ids); + if (count($ids) > 1) $ids = array_map(function($v) { return (int)$v; }, $ids); $query = 'SELECT fs_id,fs_dir,fs_name FROM '.self::TABLE.' WHERE fs_id'. (count($ids) == 1 ? '='.(int)$ids[0] : ' IN ('.implode(',',$ids).')'); if (self::LOG_LEVEL > 2) $query = '/* '.__METHOD__.': '.__LINE__.' */ '.$query; @@ -1913,7 +1913,7 @@ GROUP BY A.fs_id'; $id = $stat['ino']; } } - if (count($ids) >= 1) array_map(function(&$v) { $v = (int)$v; },$ids); + if (count($ids) >= 1) $ids = array_map(function($v) { return (int)$v; }, $ids); $query = 'SELECT * FROM '.self::PROPS_TABLE.' WHERE (fs_id'. (count($ids) == 1 ? '='.(int)implode('',$ids) : ' IN ('.implode(',',$ids).')').')'. (!is_null($ns) ? ' AND prop_namespace=?' : '');