Skip to content

Commit

Permalink
Code-style patch.
Browse files Browse the repository at this point in the history
Don't need else after early return.
  • Loading branch information
Maikuolan committed Apr 12, 2024
1 parent c16f0f5 commit 9bcf0f2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/FrontEnd.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* License: GNU/GPLv2
* @see LICENSE.txt
*
* This file: Front-end handler (last modified: 2023.12.29).
* This file: Front-end handler (last modified: 2024.04.12).
*/

namespace phpMussel\FrontEnd;
Expand Down Expand Up @@ -800,14 +800,12 @@ public function view(string $Page = ''): void
return;
}

else {
/** Strip out unexpected bytes here for security. */
$Page = preg_replace('~[^\dA-Za-z-]~', '', $Page);
/** Strip out unexpected bytes here for security. */
$Page = preg_replace('~[^\dA-Za-z-]~', '', $Page);

/** Load the page. */
if (!$this->Loader->isReserved($Page) && is_readable($this->PagesPath . $Page . '.php')) {
require_once $this->PagesPath . $Page . '.php';
}
/** Load the page. */
if (!$this->Loader->isReserved($Page) && is_readable($this->PagesPath . $Page . '.php')) {
require_once $this->PagesPath . $Page . '.php';
}
}

Expand Down

0 comments on commit 9bcf0f2

Please sign in to comment.