From 5ed66b5485d20203970d594229d32458b3244ebb Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 16 Aug 2026 16:24:58 +0900 Subject: fix(php-shim): accept negative offsets in substr_replace The signature took usize, so PHP's negative $start and $length, which count from the end of the string, could not be expressed. Take i64 and an optional length, and apply PHP's clamping rules. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/util/process_executor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/shirabe/src/util/process_executor.rs') diff --git a/crates/shirabe/src/util/process_executor.rs b/crates/shirabe/src/util/process_executor.rs index 00091029..875c8810 100644 --- a/crates/shirabe/src/util/process_executor.rs +++ b/crates/shirabe/src/util/process_executor.rs @@ -224,7 +224,7 @@ impl ProcessExecutor { &command_str, &Self::escape(&Self::get_executable(&m1)), 0, - strlen(&m1) as usize, + Some(strlen(&m1)), ); } } -- cgit v1.3.1-4-g156e