Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small misc improvements #3389

Merged
merged 11 commits into from
Jun 19, 2023
10 changes: 10 additions & 0 deletions core/classes/Core/URL.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ private static function buildNonFriendly(string $url, string $params): string {
return (defined('CONFIG_PATH') ? CONFIG_PATH : '') . '/index.php?route=' . $url . ((substr($url, -1) == '/') ? '' : '/');
}

/**
* Build an asset path
*
* @param string $path Contains the asset path relative to the root Nameless directory
* @return string
*/
public static function buildAssetPath(string $path): string {
return (defined('CONFIG_PATH') ? CONFIG_PATH : '') . '/' . ltrim($path, '/');
}

/**
* Get the server name.
*
Expand Down
6 changes: 3 additions & 3 deletions core/classes/Database/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,9 @@ public function addColumn(string $table, string $column, string $attributes): bo
* column, operator (default =), value, and glue (default AND).
* @return array The where clause string, and parameters to bind.
*/
private function makeWhere(array $clauses): array {
public static function makeWhere(array $clauses): array {
if (count($clauses) === count($clauses, COUNT_RECURSIVE)) {
return $this->makeWhere([$clauses]);
return self::makeWhere([$clauses]);
}

$where_clauses = [];
Expand All @@ -486,7 +486,7 @@ private function makeWhere(array $clauses): array {
}

if (count($clause) !== count($clause, COUNT_RECURSIVE)) {
$this->makeWhere(...$clause);
self::makeWhere(...$clause);
continue;
}

Expand Down