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

fix: unnecessary lowercasing parameters #2877

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/URLHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/**
* Check to see if the URL begins with the string in question
* Because it's a URL we don't care about protocol (HTTP vs HTTPS)
* Or case (so it's cAsE iNsEnSeTiVe)
* Or case (so it's cAsE iNsEnSiTiVe)
*
* @api
* @return boolean
Expand Down Expand Up @@ -290,7 +290,7 @@
'timber/url_helper/get_content_subdir/home_url'
);

return \str_replace($home_url, '', WP_CONTENT_URL);

Check failure on line 293 in src/URLHelper.php

View workflow job for this annotation

GitHub Actions / PHP static analysis

Constant WP_CONTENT_URL not found.
}

/**
Expand All @@ -304,7 +304,7 @@
return \str_replace(ABSPATH, '', $src);
}
// its outside the WordPress directory, alternate setups:
$src = \str_replace(WP_CONTENT_DIR, '', $src);

Check failure on line 307 in src/URLHelper.php

View workflow job for this annotation

GitHub Actions / PHP static analysis

Constant WP_CONTENT_DIR not found.
return self::get_content_subdir() . $src;
}

Expand Down Expand Up @@ -535,8 +535,7 @@

/**
* Returns the url path parameters, or a single parameter if given an index.
* Normalizes REQUEST_URI to lower-case. Returns false if given a
* non-existent index.
* Returns false if given a non-existent index.
*
* @example
* ```php
Expand All @@ -563,7 +562,7 @@
*/
public static function get_params($i = false)
{
$uri = \trim(\strtolower($_SERVER['REQUEST_URI']));
$uri = \trim($_SERVER['REQUEST_URI']);
$params = \array_values(\array_filter(\explode('/', $uri)));

if (false === $i) {
Expand Down