diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-21 17:42:32 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-21 17:42:32 +0900 |
| commit | f05e1a55cf0d44e9611e06a3d7b4fccdcb90ce7b (patch) | |
| tree | b93311ab2473b988051f0285efb7181afe301fe5 /crates/shirabe/src/config.rs | |
| parent | 277dc4065d2eb0d6621a6aa56a299a0d2369caf7 (diff) | |
| download | php-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/config.rs')
| -rw-r--r-- | crates/shirabe/src/config.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/shirabe/src/config.rs b/crates/shirabe/src/config.rs index b65961e..bb46483 100644 --- a/crates/shirabe/src/config.rs +++ b/crates/shirabe/src/config.rs @@ -11,10 +11,10 @@ use anyhow::Result; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ - E_USER_DEPRECATED, FILTER_VALIDATE_URL, PHP_URL_HOST, PHP_URL_SCHEME, PhpMixed, - RuntimeException, array_key_exists, array_merge, array_reverse, array_search_mixed, - array_unique, current, empty, filter_var, implode, in_array, is_array, is_int, is_string, key, - parse_url, php_to_string, reset, rtrim, strtolower, strtoupper, strtr, substr, trigger_error, + E_USER_DEPRECATED, PHP_URL_HOST, PHP_URL_SCHEME, PhpMixed, RuntimeException, array_key_exists, + array_merge, array_reverse, array_search_mixed, array_unique, current, empty, filter_var_url, + implode, in_array, is_array, is_int, is_string, key, parse_url, php_to_string, reset, rtrim, + strtolower, strtoupper, strtr, substr, trigger_error, }; use std::cell::RefCell; @@ -1103,7 +1103,7 @@ impl Config { repo_options: &IndexMap<String, PhpMixed>, ) -> Result<()> { // Return right away if the URL is malformed or custom (see issue #5173), but only for non-HTTP(S) URLs - if !filter_var(url, FILTER_VALIDATE_URL) && !Preg::is_match(r"{^https?://}", url) { + if !filter_var_url(url) && !Preg::is_match(r"{^https?://}", url) { return Ok(()); } |
