Author: Sara Golemon (sgolemon)
Date: 2021-07-04T23:01:16Z
Commit:
https://github.com/php/web-php/commit/f5737afaf54b2b14c311771a22c86b55114d845a
Raw diff:
https://github.com/php/web-php/commit/f5737afaf54b2b14c311771a22c86b55114d845a.diff
Modernize a term lookup map slightly
Changed paths:
M include/errors.inc
Diff:
diff --git a/include/errors.inc b/include/errors.inc
index 74408841d..f143ff2fb 100644
--- a/include/errors.inc
+++ b/include/errors.inc
@@ -507,13 +507,8 @@ $snippets = array(
See also the list of <a href="/extensions">PHP extensions</a>',
);
- $term = strtolower(trim($term));
- if (isset($term[0]) && $term[0] === '$') {
- $term = ltrim($term, '$');
- }
-
- return isset($snippets[$term]) ? $snippets[$term] : false;
-
+ $term = ltrim(strtolower(trim($term)), '$');
+ return $snippets[$term] ?? false;
}
/**
--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php