diff options
author | Andreas Gohr <andi@splitbrain.org> | 2024-01-11 10:09:01 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2024-01-11 10:09:01 +0100 |
commit | 079b7b26fad3c489a72e19ef1715cd5585f83612 (patch) | |
tree | ba0b0c2b8d1ba31762c19fee6e91b739e58812e0 /inc/Remote | |
parent | 4385690f2a92b6ccf5d1a28cfe27e575c49d574d (diff) | |
download | dokuwiki-079b7b26fad3c489a72e19ef1715cd5585f83612.tar.gz dokuwiki-079b7b26fad3c489a72e19ef1715cd5585f83612.zip |
LegacyAPI: fix return types on missing pages
Diffstat (limited to 'inc/Remote')
-rw-r--r-- | inc/Remote/LegacyApiCore.php | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/inc/Remote/LegacyApiCore.php b/inc/Remote/LegacyApiCore.php index b899dc551..7b9b7211a 100644 --- a/inc/Remote/LegacyApiCore.php +++ b/inc/Remote/LegacyApiCore.php @@ -95,7 +95,14 @@ class LegacyApiCore extends ApiCore */ public function legacyGetPage($id) { - return $this->getPage($id); + try { + return $this->getPage($id); + } catch (RemoteException $e) { + if ($e->getCode() === 121) { + return ''; + } + throw $e; + } } /** @@ -103,7 +110,14 @@ class LegacyApiCore extends ApiCore */ public function legacyGetPageVersion($id, $rev = '') { - return $this->getPage($id, $rev); + try { + return $this->getPage($id, $rev); + } catch (RemoteException $e) { + if ($e->getCode() === 121) { + return ''; + } + throw $e; + } } /** @@ -131,7 +145,14 @@ class LegacyApiCore extends ApiCore */ public function legacyGetPageHTML($id) { - return $this->getPageHTML($id); + try { + return $this->getPageHTML($id); + } catch (RemoteException $e) { + if ($e->getCode() === 121) { + return ''; + } + throw $e; + } } /** @@ -139,7 +160,14 @@ class LegacyApiCore extends ApiCore */ public function legacyGetPageHTMLVersion($id, $rev = '') { - return $this->getPageHTML($id, (int)$rev); + try { + return $this->getPageHTML($id, (int)$rev); + } catch (RemoteException $e) { + if ($e->getCode() === 121) { + return ''; + } + throw $e; + } } /** |