{"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":"65f485cc09b46715767b549ea8681b8ca5453c5e82ce3bfe14b35e2b38dcd44e","isBugfix":0.8782,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.8329,"feature":0.0046,"refactor":0.0578,"tests_only":0.0068,"docs_only":0.0067,"dependency":0.0041,"cleanup":0.0871},"confidence":0.6556},"scope":{"score":1.0123,"probabilities":{"0":0.0697,"1":0.8482,"2":0.0821},"confidence":0.5965},"risk":{"score":0.2984,"probabilities":{"0":0.7344,"1":0.2327,"2":0.0329},"confidence":0.3919},"area":{"choice":"framework","probabilities":{"catalog":0.0076,"checkout":0.0071,"customer":0.0049,"admin":0.009,"graphql_api":0.0047,"framework":0.9328,"frontend":0.0265,"other":0.0074},"confidence":0.8526},"securityRelevant":0.9401,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0119,"2.4.0-p1":0.0063,"2.4.1":0.0042,"2.4.1-p1":0.0039,"2.4.2":0.0054,"2.4.2-p1":0.0059,"2.4.2-p2":0.0084,"2.4.3":0.0135,"2.4.3-p1":0.0138,"2.4.3-p2":0.0124,"2.4.3-p3":0.0068,"2.4.4":0.0151,"2.4.4-p1":0.0122,"2.4.4-p10":0.0074,"2.4.4-p11":0.0092,"2.4.4-p12":0.007,"2.4.4-p13":0.0069,"2.4.4-p14":0.0087,"2.4.4-p15":0.0061,"2.4.4-p16":0.0067,"2.4.4-p17":0.0051,"2.4.4-p18":0.0048,"2.4.4-p2":0.003,"2.4.4-p3":0.0043,"2.4.4-p4":0.0045,"2.4.4-p5":0.0045,"2.4.4-p6":0.0045,"2.4.4-p7":0.0046,"2.4.4-p8":0.0051,"2.4.4-p9":0.0045,"2.4.5":0.0109,"2.4.5-p1":0.0086,"2.4.5-p10":0.0061,"2.4.5-p11":0.0095,"2.4.5-p12":0.0078,"2.4.5-p13":0.0064,"2.4.5-p14":0.0068,"2.4.5-p15":0.005,"2.4.5-p16":0.0055,"2.4.5-p17":0.0059,"2.4.5-p2":0.0031,"2.4.5-p3":0.0044,"2.4.5-p4":0.0053,"2.4.5-p5":0.0044,"2.4.5-p6":0.0046,"2.4.5-p7":0.005,"2.4.5-p8":0.0039,"2.4.5-p9":0.0035,"2.4.6":0.0285,"2.4.6-p1":0.014,"2.4.6-p10":0.01,"2.4.6-p11":0.0102,"2.4.6-p12":0.0096,"2.4.6-p13":0.0076,"2.4.6-p14":0.0081,"2.4.6-p15":0.0068,"2.4.6-p2":0.0039,"2.4.6-p3":0.0063,"2.4.6-p4":0.008,"2.4.6-p5":0.006,"2.4.6-p6":0.0071,"2.4.6-p7":0.0076,"2.4.6-p8":0.0054,"2.4.6-p9":0.0044,"2.4.7":0.0126,"2.4.7-p1":0.0086,"2.4.7-p10":0.0074,"2.4.7-p2":0.0051,"2.4.7-p3":0.0094,"2.4.7-p4":0.0136,"2.4.7-p5":0.0092,"2.4.7-p6":0.0127,"2.4.7-p7":0.0097,"2.4.7-p8":0.0077,"2.4.7-p9":0.0055,"2.4.8":0.0159,"2.4.8-p1":0.0123,"2.4.8-p2":0.0159,"2.4.8-p3":0.0149,"2.4.8-p4":0.0145,"2.4.8-p5":0.0115,"2.4.9":0.016,"unspecified":0.3306},"confidence":0.1054},"backportWorthy":{"score":0.644,"probabilities":{"0":0.5465,"1":0.263,"2":0.1905},"confidence":0.1062}},"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"}