From: Vincent Vanwaelscappel Date: Fri, 28 Apr 2023 09:50:46 +0000 (+0200) Subject: wait #5897 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5edecba650ee428f7d6be6afa9ba4cf83f40c371;p=fluidbook_tools.git wait #5897 @0:20 --- diff --git a/src/Links/Link.php b/src/Links/Link.php index b315f85..60edcdf 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -427,9 +427,13 @@ class Link { } } - public function overlapDoublePage() { + public function isOnNormalPage() { // $this->page is normally an integer but it can also be a string (eg. background / aftersearch) - if (!is_int($this->page)) { + return is_int($this->page) || preg_match('/^\d+$/', $this->page, $matches); + } + + public function overlapDoublePage() { + if (!$this->isOnNormalPage()) { return false; } return ($this->page % 2 == 0 && ($this->left + $this->width) > $this->compiler->getWidthForLinks());