From 5edecba650ee428f7d6be6afa9ba4cf83f40c371 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 28 Apr 2023 11:50:46 +0200 Subject: [PATCH] wait #5897 @0:20 --- src/Links/Link.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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()); -- 2.39.5