[php-src] master: Fix test to use non-interned string (#25370)

From: Date: Fri, 13 Nov 2026 08:29:56 +0000
Subject: [php-src] master: Fix test to use non-interned string (#25370)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-143681@lists.php.net to get a copy of this message
Author: Ayke Halder (rr-it) Committer: Weilin Du (LamentXU123) Date: 2026-11-13T16:26:52+08:00 Commit: https://github.com/php/php-src/commit/fe1f331245ba00f1edf87630469e609104839f3f Raw diff: https://github.com/php/php-src/commit/fe1f331245ba00f1edf87630469e609104839f3f.diff Fix test to use non-interned string (#25370) The str_repeat() optimization in 93fd714d returns the input string when called with a multiplier of 1. The innerHTML test therefore uses an interned string even though it intends to exercise a non-interned string with the UTF-8 validity flag set. random_int(1, 1) also returns 1 directly. Repeat the input twice to create a non-interned string, and update the expected output to match. Closes #25370 Changed paths: M ext/dom/tests/modern/html/parser/Element_innerHTML.phpt Diff: diff --git a/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt b/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt index 89574b7a631f..7e76cad0a128 100644 --- a/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt +++ b/ext/dom/tests/modern/html/parser/Element_innerHTML.phpt @@ -20,7 +20,7 @@ $el->innerHTML = "invalid\xffutf-8๐ˆ๐ˆ๐ˆ"; echo $dom->saveXML(), "\n"; // Create a non-interned string that gets the UTF-8 validity flag added -$str = str_repeat("my valid string", random_int(1, 1)); +$str = str_repeat("my valid string", random_int(2, 2)); preg_match('/^.*$/u', $str); $el->innerHTML = $str; echo $dom->saveXML(), "\n"; @@ -56,7 +56,7 @@ echo $dom->saveXML(), "\n"; <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <div xmlns="http://www.w3.org/1999/xhtml">invalid๏ฟฝutf-8๐ˆ๐ˆ๐ˆ</div> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<div xmlns="http://www.w3.org/1999/xhtml">my valid string</div> +<div xmlns="http://www.w3.org/1999/xhtml">my valid stringmy valid string</div> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <style xmlns="http://www.w3.org/1999/xhtml">&lt;p&gt;foo&lt;/p&gt;</style> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

« previous php.cvs (#143681) next »