diff options
| author | wn_ <invalid@email.com> | 2024-11-23 18:23:49 +0000 |
|---|---|---|
| committer | wn_ <invalid@email.com> | 2024-11-24 13:59:29 +0000 |
| commit | 667528d5b927f0f284a067b0e24c9ca7f26c28a4 (patch) | |
| tree | f28c7ece3584a7852b6562020246b1de6167774e /backend.php | |
| parent | 53fee911e6a39a5c8504d03d1f114a131d00784c (diff) | |
Use PHP 8 'str_' functions.
A few more characters in some places, but helps with readability.
Diffstat (limited to 'backend.php')
| -rw-r--r-- | backend.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/backend.php b/backend.php index f54ad87d3..860a3940c 100644 --- a/backend.php +++ b/backend.php @@ -96,7 +96,7 @@ ]; // shortcut syntax for plugin methods (?op=plugin--pmethod&...params) - /* if (strpos($op, PluginHost::PUBLIC_METHOD_DELIMITER) !== false) { + /* if (str_contains($op, PluginHost::PUBLIC_METHOD_DELIMITER)) { list ($plugin, $pmethod) = explode(PluginHost::PUBLIC_METHOD_DELIMITER, $op, 2); // TODO: better implementation that won't modify $_REQUEST @@ -111,7 +111,7 @@ if (class_exists($op) || $override) { - if (strpos($method, "_") === 0) { + if (str_starts_with($method, "_")) { user_error("Refusing to invoke method $method of handler $op which starts with underscore.", E_USER_WARNING); header("Content-Type: text/json"); print Errors::to_json(Errors::E_UNAUTHORIZED); |