From 1646f5e631704239442ffa8ffba71a793573c55b Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 2 Apr 2019 11:33:27 +0200 Subject: [PATCH] fixes #998 temporary fix for Piwigo Remote Sync compatibility --- include/ws_functions/pwg.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/ws_functions/pwg.php b/include/ws_functions/pwg.php index 88b7c02e8..4b6de0d42 100644 --- a/include/ws_functions/pwg.php +++ b/include/ws_functions/pwg.php @@ -327,7 +327,13 @@ function ws_session_getStatus($params, &$service) list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); $res['current_datetime'] = $dbnow; $res['version'] = PHPWG_VERSION; - $res['available_sizes'] = array_keys(ImageStdParams::get_defined_type_map()); + + // Piwigo Remote Sync does not support receiving the available sizes + $piwigo_remote_sync_agent = 'Apache-HttpClient/'; + if (!isset($_SERVER['HTTP_USER_AGENT']) or substr($_SERVER['HTTP_USER_AGENT'], 0, strlen($piwigo_remote_sync_agent)) !== $piwigo_remote_sync_agent) + { + $res['available_sizes'] = array_keys(ImageStdParams::get_defined_type_map()); + } if (is_admin()) {