{"data":{"id":"magento2-40201","source":"github-pr","sourceRef":"magento/magento2#40201","title":"Condition is never met in `\\Magento\\Framework\\Escaper::escapeScriptIdentifiers`","pr":{"number":40201,"url":"https://github.com/magento/magento2/pull/40201","author":"wubinworks","mergedAt":"2025-11-19T09:41:00Z","mergeCommit":"a02c255dcc559244c671d5809e5fa84cefadef9d","headCommit":"fea5af033bd77a27b4d1e2990c04d8f1c77db4f1","baseRef":"2.4-develop","diffSha256":"1d664367738f37c3a0805f530b7a6f52060277c46f138b19d80ff1a751f13854"},"issues":[{"number":40195,"url":"https://github.com/magento/magento2/issues/40195","title":"Condition is never met in `\\Magento\\Framework\\Escaper::escapeScriptIdentifiers`","labels":["Area: Framework","Component: Framework/Escaper","Issue: Confirmed","Priority: P2","Progress: PR Created","Progress: done","Reported on 2.4.x","Reproduced on 2.4.x"],"kind":"human"}],"fixedIn":"2.4.9","containingTags":["2.4.9"],"reportedOn":null,"codeMatch":{"2.4.6":"clean","2.4.6-p1":"clean","2.4.6-p2":"clean","2.4.6-p3":"clean","2.4.6-p4":"clean","2.4.6-p5":"clean","2.4.6-p6":"clean","2.4.6-p7":"clean","2.4.6-p8":"clean","2.4.6-p9":"clean","2.4.6-p10":"clean","2.4.6-p11":"clean","2.4.6-p12":"clean","2.4.6-p13":"clean","2.4.6-p14":"clean","2.4.6-p15":"clean","2.4.7":"clean","2.4.7-p1":"clean","2.4.7-p2":"clean","2.4.7-p3":"clean","2.4.7-p4":"clean","2.4.7-p5":"clean","2.4.7-p6":"clean","2.4.7-p7":"clean","2.4.7-p8":"clean","2.4.7-p9":"clean","2.4.7-p10":"clean","2.4.8":"clean","2.4.8-p1":"clean","2.4.8-p2":"clean","2.4.8-p3":"clean","2.4.8-p4":"clean","2.4.8-p5":"clean","2.4.9":"conflict"},"affectedVersions":["2.4.6","2.4.6-p1","2.4.6-p2","2.4.6-p3","2.4.6-p4","2.4.6-p5","2.4.6-p6","2.4.6-p7","2.4.6-p8","2.4.6-p9","2.4.6-p10","2.4.6-p11","2.4.6-p12","2.4.6-p13","2.4.6-p14","2.4.6-p15","2.4.7","2.4.7-p1","2.4.7-p2","2.4.7-p3","2.4.7-p4","2.4.7-p5","2.4.7-p6","2.4.7-p7","2.4.7-p8","2.4.7-p9","2.4.7-p10","2.4.8","2.4.8-p1","2.4.8-p2","2.4.8-p3","2.4.8-p4","2.4.8-p5"],"components":["magento/framework"],"files":[{"path":"lib/internal/Magento/Framework/Escaper.php","change":"modified","package":"magento/framework"}],"stripped":{"tests":[],"docs":[],"outsideCode":[]},"linesChanged":12,"mergeBatched":false,"excluded":null,"sections":{"description":"Check if `$filteredData` is `false`.","stepsToReproduce":"In [`\\Magento\\Framework\\Escaper::escapeScriptIdentifiers`](https://github.com/magento/magento2/blob/4baea6d63e6cc645e7417998e930117d590c88a2/lib/internal/Magento/Framework/Escaper.php#L407):\n\n[Here](https://github.com/magento/magento2/blob/4baea6d63e6cc645e7417998e930117d590c88a2/lib/internal/Magento/Framework/Escaper.php#L410) and [here](https://github.com/magento/magento2/blob/4baea6d63e6cc645e7417998e930117d590c88a2/lib/internal/Magento/Framework/Escaper.php#L415), `$filteredData === false` will never be met since `preg_replace` only returns `string|array|null`.\n\nSee `preg_replace` [documentation](https://www.php.net/manual/en/function.preg-replace.php#refsect1-function.preg-replace-returnvalues).","expectedResult":"Check if `$filteredData` is `NULL`.","actualResult":"Check if `$filteredData` is `false`.","source":"issue"},"signatures":[],"labels":{"area":["Framework"],"component":["Framework/Escaper"],"priority":"P2","severity":null,"reportedOn":["2.4.x"]},"categories":[],"triage":{"model":"@cf/cloudflare/clef","requestHash":"8eaaa50e44c8ffa58bf0766f8738ca3766fb2315963fa991c047bee199182c82","isBugfix":0.9214,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.9135,"feature":0.0052,"refactor":0.0637,"tests_only":0.0063,"docs_only":0.0064,"dependency":0.0049},"confidence":0.8063},"scope":{"score":1.0131,"probabilities":{"0":0.0668,"1":0.8534,"2":0.0798},"confidence":0.6088},"risk":{"score":0.3092,"probabilities":{"0":0.7243,"1":0.2422,"2":0.0335},"confidence":0.3766},"area":{"choice":"framework","probabilities":{"catalog":0.0069,"checkout":0.0068,"customer":0.0048,"admin":0.0085,"graphql_api":0.0047,"framework":0.9373,"frontend":0.0239,"other":0.0071},"confidence":0.8621},"securityRelevant":0.937,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0098,"2.4.0-p1":0.0056,"2.4.1":0.0042,"2.4.1-p1":0.0036,"2.4.2":0.0052,"2.4.2-p1":0.0056,"2.4.2-p2":0.0077,"2.4.3":0.0142,"2.4.3-p1":0.0122,"2.4.3-p2":0.0114,"2.4.3-p3":0.0068,"2.4.4":0.0118,"2.4.4-p1":0.0112,"2.4.4-p10":0.0066,"2.4.4-p11":0.0087,"2.4.4-p12":0.0061,"2.4.4-p13":0.0063,"2.4.4-p14":0.0077,"2.4.4-p15":0.0054,"2.4.4-p16":0.006,"2.4.4-p17":0.005,"2.4.4-p18":0.0046,"2.4.4-p2":0.0029,"2.4.4-p3":0.0038,"2.4.4-p4":0.0047,"2.4.4-p5":0.004,"2.4.4-p6":0.0044,"2.4.4-p7":0.0042,"2.4.4-p8":0.0042,"2.4.4-p9":0.004,"2.4.5":0.0108,"2.4.5-p1":0.0084,"2.4.5-p10":0.0057,"2.4.5-p11":0.0083,"2.4.5-p12":0.0074,"2.4.5-p13":0.0063,"2.4.5-p14":0.0067,"2.4.5-p15":0.0048,"2.4.5-p16":0.0052,"2.4.5-p17":0.0055,"2.4.5-p2":0.0029,"2.4.5-p3":0.0037,"2.4.5-p4":0.0043,"2.4.5-p5":0.0046,"2.4.5-p6":0.0046,"2.4.5-p7":0.0049,"2.4.5-p8":0.0041,"2.4.5-p9":0.0033,"2.4.6":0.0178,"2.4.6-p1":0.0116,"2.4.6-p10":0.0087,"2.4.6-p11":0.0085,"2.4.6-p12":0.0085,"2.4.6-p13":0.0069,"2.4.6-p14":0.0079,"2.4.6-p15":0.0059,"2.4.6-p2":0.0037,"2.4.6-p3":0.0064,"2.4.6-p4":0.007,"2.4.6-p5":0.0052,"2.4.6-p6":0.0063,"2.4.6-p7":0.0076,"2.4.6-p8":0.0051,"2.4.6-p9":0.0041,"2.4.7":0.0123,"2.4.7-p1":0.0084,"2.4.7-p10":0.0078,"2.4.7-p2":0.0048,"2.4.7-p3":0.0089,"2.4.7-p4":0.0125,"2.4.7-p5":0.0089,"2.4.7-p6":0.0131,"2.4.7-p7":0.0098,"2.4.7-p8":0.0074,"2.4.7-p9":0.0054,"2.4.8":0.0126,"2.4.8-p1":0.0105,"2.4.8-p2":0.0136,"2.4.8-p3":0.0136,"2.4.8-p4":0.0124,"2.4.8-p5":0.0102,"2.4.9":0.013,"unspecified":0.3942},"confidence":0.1505},"backportWorthy":{"score":0.6894,"probabilities":{"0":0.5191,"1":0.2724,"2":0.2085},"confidence":0.0807}},"curated":{"title":"Fixes Escaper checking preg_replace results for false instead of null","description":"In Magento\\Framework\\Escaper::escapeScriptIdentifiers the condition $filteredData === false is never met, since preg_replace only returns string, array or null. The check now tests for NULL, and the inlineSensitiveEscapeHthmlAttr method name typo is corrected.","categories":[],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":null},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-40201 details"}