aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/error_handler.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-21 17:42:32 +0900
committernsfisis <nsfisis@gmail.com>2026-06-21 17:42:32 +0900
commitf05e1a55cf0d44e9611e06a3d7b4fccdcb90ce7b (patch)
treeb93311ab2473b988051f0285efb7181afe301fe5 /crates/shirabe/src/util/error_handler.rs
parent277dc4065d2eb0d6621a6aa56a299a0d2369caf7 (diff)
downloadphp-shirabe-f05e1a55cf0d44e9611e06a3d7b4fccdcb90ce7b.tar.gz
php-shirabe-f05e1a55cf0d44e9611e06a3d7b4fccdcb90ce7b.tar.zst
php-shirabe-f05e1a55cf0d44e9611e06a3d7b4fccdcb90ce7b.zip
refactor(php-shim): split filter_var into per-filter functions
Replace the dispatch-on-constant filter_var() and filter_var_with_options() with dedicated filter_var_boolean/url/email/ip and filter_var_int_with_range, dropping the FILTER_VALIDATE_* constants and updating all call sites. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/error_handler.rs')
-rw-r--r--crates/shirabe/src/util/error_handler.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/shirabe/src/util/error_handler.rs b/crates/shirabe/src/util/error_handler.rs
index e0590d9..b9210fc 100644
--- a/crates/shirabe/src/util/error_handler.rs
+++ b/crates/shirabe/src/util/error_handler.rs
@@ -3,9 +3,9 @@
use crate::io::IOInterface;
use crate::io::IOInterfaceImmutable;
use shirabe_php_shim::{
- E_ALL, E_DEPRECATED, E_USER_DEPRECATED, E_USER_WARNING, E_WARNING, ErrorException,
- FILTER_VALIDATE_BOOLEAN, PHP_EOL, PhpMixed, STDERR, debug_backtrace, error_reporting,
- filter_var, ini_get, is_resource, set_error_handler,
+ E_ALL, E_DEPRECATED, E_USER_DEPRECATED, E_USER_WARNING, E_WARNING, ErrorException, PHP_EOL,
+ PhpMixed, STDERR, debug_backtrace, error_reporting, filter_var_boolean, ini_get, is_resource,
+ set_error_handler,
};
use std::cell::{Cell, RefCell};
use std::rc::Rc;
@@ -37,7 +37,7 @@ impl ErrorHandler {
let mut message = message;
let xdebug_scream = ini_get("xdebug.scream").unwrap_or_default();
- if filter_var(&xdebug_scream, FILTER_VALIDATE_BOOLEAN) {
+ if filter_var_boolean(&xdebug_scream) {
message += "\n\nWarning: You have xdebug.scream enabled, the warning above may be\na legitimately suppressed error that you were not supposed to see.";
}