From b834ffbdbcf05eef76efd9bbc68eacdcb7f0f314 Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Mon, 17 Aug 2026 21:00:38 +0200 Subject: [PATCH] Fix SQL query strings in orphan sync --- include/nc_orphan_ws.inc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/nc_orphan_ws.inc.php b/include/nc_orphan_ws.inc.php index 9e4680d..447eedd 100644 --- a/include/nc_orphan_ws.inc.php +++ b/include/nc_orphan_ws.inc.php @@ -71,7 +71,10 @@ function bratonien_tools_nc_root_files($basedir) function bratonien_tools_nc_existing_root_orphans($basedir) { $rows = array(); - $query = '\nSELECT id, path\n FROM '.IMAGES_TABLE.'\n WHERE storage_category_id IS NULL'; + $query = ' +SELECT id, path + FROM '.IMAGES_TABLE.' + WHERE storage_category_id IS NULL'; $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { @@ -161,7 +164,11 @@ function bratonien_tools_ws_nc_sync_orphans($params, &$service) return new PwgError(400, 'Invalid site_id.'); } - $query = '\nSELECT galleries_url\n FROM '.SITES_TABLE.'\n WHERE id = '.$site_id.'\n LIMIT 1'; + $query = ' +SELECT galleries_url + FROM '.SITES_TABLE.' + WHERE id = '.$site_id.' + LIMIT 1'; $result = pwg_query($query); if (!pwg_db_num_rows($result)) {