Skip to content

Commit

Permalink
Refactor getPageQuery method in class.homepage.php to simplify qu…
Browse files Browse the repository at this point in the history
…ery handling logic
  • Loading branch information
N6REJ committed Aug 31, 2024
1 parent 709182e commit e7f19ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1,373 deletions.
20 changes: 9 additions & 11 deletions core/classes/class.homepage.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,16 @@ public function getPage()
* @param string $query The query string to construct.
* @return string The constructed page query string.
*/
public function getPageQuery($query)
{
$request = '';
if (!empty($query) && in_array($query, $this->pageList) && $query != self::PAGE_INDEX) {
$request = '?p=' . $query;
} elseif (!empty($query) && in_array($query, $this->pageStdl)) {
$request = $query;
} elseif (!empty($query) && self::PAGE_INDEX) {
$request = "index.php";
}
return $request;
public function getPageQuery($query)
{
$request = '';
if (!empty($query) && in_array($query, $this->pageList) && $query != self::PAGE_INDEX) {
$request = '?p=' . $query;
} elseif (!empty($query) && $query == self::PAGE_INDEX) {
$request = "index.php";
}
return $request;
}

/**
* Constructs the full URL for the given page query.
Expand Down
Loading

0 comments on commit e7f19ba

Please sign in to comment.