Skip to content

Commit 145291f

Browse files
committed
Fix PHP Warning
1 parent 1887541 commit 145291f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/WebApp/Router.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ protected function initPagePath() {
140140

141141
// strip off app path from path
142142
$pathElems = explode('/', $this->request->pagePath);
143-
while ($pathElems[0] === '') array_shift($pathElems);
143+
while ((count($pathElems) > 0) && ($pathElems[0] === '')) array_shift($pathElems);
144144
// Check language
145145
if (count($pathElems) > 0) {
146146
if ($this->hasLanguage($pathElems[0])) {
@@ -154,7 +154,7 @@ protected function initPagePath() {
154154
$this->request->language = $this->getDefaultLanguage();
155155
}
156156
}
157-
while ($pathElems[0] === '') array_shift($pathElems);
157+
while ((count($pathElems) > 0) && ($pathElems[0] === '')) array_shift($pathElems);
158158
$this->request->pagePathElements = $pathElems;
159159
$this->request->useLanguagePath = count($this->languages) > 1;
160160

0 commit comments

Comments
 (0)