mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Fix #73817: Incorrect entries in get_html_translation_table
Due to incorrect string termination and length handling, several HTML entities missed the trailing semicolon. We also fix the obviously wrong expectations in two already existing tests.
This commit is contained in:
parent
141072a838
commit
0f8c1ee76d
5 changed files with 84 additions and 68 deletions
3
NEWS
3
NEWS
|
@ -9,6 +9,9 @@ PHP NEWS
|
|||
- PDO_Firebird:
|
||||
. Fixed bug #76488 (Memory leak when fetching a BLOB field). (Simonov Denis)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #73817 (Incorrect entries in get_html_translation_table). (cmb)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #76524 (ZipArchive memory leak (OVERWRITE flag and empty archive)).
|
||||
(Timur Ibragimov)
|
||||
|
|
|
@ -1598,8 +1598,7 @@ static inline void write_s3row_data(
|
|||
written_k2 = write_octet_sequence((unsigned char*)&key[written_k1], charset, spe_cp);
|
||||
memcpy(&entity[1], mcpr[i].normal_entry.entity, l);
|
||||
entity[l + 1] = ';';
|
||||
entity[l + 1] = '\0';
|
||||
add_assoc_stringl_ex(arr, key, written_k1 + written_k2, entity, l + 1);
|
||||
add_assoc_stringl_ex(arr, key, written_k1 + written_k2, entity, l + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
14
ext/standard/tests/strings/bug73817.phpt
Normal file
14
ext/standard/tests/strings/bug73817.phpt
Normal file
|
@ -0,0 +1,14 @@
|
|||
--TEST--
|
||||
Bug #73817 (Incorrect entries in get_html_translation_table)
|
||||
--FILE--
|
||||
<?php
|
||||
$entities = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES | ENT_HTML5);
|
||||
foreach ($entities as $entity) {
|
||||
if (substr($entity, -1) !== ';') {
|
||||
var_dump($entity);
|
||||
}
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
|
@ -273,27 +273,27 @@ Array
|
|||
[≢] => ≢
|
||||
[≭] => ≭
|
||||
[≠] => ≠
|
||||
[≧̸] => &NotGreaterFullEqual
|
||||
[≫̸] => &NotGreaterGreater
|
||||
[≧̸] => ≧̸
|
||||
[≫̸] => ≫̸
|
||||
[≹] => ≹
|
||||
[⧏̸] => &NotLeftTriangleBar
|
||||
[⧏̸] => ⧏̸
|
||||
[≮] => ≮
|
||||
[≰] => ≰
|
||||
[⪢̸] => &NotNestedGreaterGreater
|
||||
[⪡̸] => &NotNestedLessLess
|
||||
[⪯̸] => &NotPrecedesEqual
|
||||
[⪢̸] => ⪢̸
|
||||
[⪡̸] => ⪡̸
|
||||
[⪯̸] => ⪯̸
|
||||
[⋠] => ⋠
|
||||
[⧐̸] => &NotRightTriangleBar
|
||||
[⧐̸] => ⧐̸
|
||||
[⋭] => ⋭
|
||||
[⊏̸] => &NotSquareSubset
|
||||
[⊏̸] => ⊏̸
|
||||
[⋢] => ⋢
|
||||
[⊐̸] => &NotSquareSuperset
|
||||
[⊐̸] => ⊐̸
|
||||
[⋣] => ⋣
|
||||
[⊈] => ⊈
|
||||
[⊁] => ⊁
|
||||
[⪰̸] => &NotSucceedsEqual
|
||||
[⪰̸] => ⪰̸
|
||||
[⋡] => ⋡
|
||||
[≿̸] => &NotSucceedsTilde
|
||||
[≿̸] => ≿̸
|
||||
[⊉] => ⊉
|
||||
[≁] => ≁
|
||||
[𝒩] => 𝒩
|
||||
|
@ -394,7 +394,7 @@ Array
|
|||
[Т] => Т
|
||||
[𝔗] => 𝔗
|
||||
[Θ] => Θ
|
||||
[ ] => &ThickSpace
|
||||
[ ] =>   
|
||||
[ ] =>  
|
||||
[≅] => ≅
|
||||
[𝕋] => 𝕋
|
||||
|
@ -469,7 +469,7 @@ Array
|
|||
[á] => á
|
||||
[ă] => ă
|
||||
[∾] => ∾
|
||||
[∾̳] => &acE
|
||||
[∾̳] => ∾̳
|
||||
[∿] => ∿
|
||||
[â] => â
|
||||
[а] => а
|
||||
|
@ -552,8 +552,8 @@ Array
|
|||
[░] => ░
|
||||
[▓] => ▓
|
||||
[█] => █
|
||||
[=⃥] => &bne
|
||||
[≡⃥] => &bnequiv
|
||||
[=⃥] => =⃥
|
||||
[≡⃥] => ≡⃥
|
||||
[⌐] => ⌐
|
||||
[𝕓] => 𝕓
|
||||
[⋈] => ⋈
|
||||
|
@ -616,7 +616,7 @@ Array
|
|||
[⩋] => ⩋
|
||||
[⩇] => ⩇
|
||||
[⩀] => ⩀
|
||||
[∩︀] => &caps
|
||||
[∩︀] => ∩︀
|
||||
[⁁] => ⁁
|
||||
[⩍] => ⩍
|
||||
[č] => č
|
||||
|
@ -668,7 +668,7 @@ Array
|
|||
[⩊] => ⩊
|
||||
[⊍] => ⊍
|
||||
[⩅] => ⩅
|
||||
[∪︀] => &cups
|
||||
[∪︀] => ∪︀
|
||||
[↷] => ↷
|
||||
[⤼] => ⤼
|
||||
[⋞] => ⋞
|
||||
|
@ -772,7 +772,7 @@ Array
|
|||
[ffl] => ffl
|
||||
[𝔣] => 𝔣
|
||||
[fi] => fi
|
||||
[fj] => &fjlig
|
||||
[fj] => fj
|
||||
[♭] => ♭
|
||||
[fl] => fl
|
||||
[▱] => ▱
|
||||
|
@ -814,7 +814,7 @@ Array
|
|||
[⪀] => ⪀
|
||||
[⪂] => ⪂
|
||||
[⪄] => ⪄
|
||||
[⋛︀] => &gesl
|
||||
[⋛︀] => ⋛︀
|
||||
[⪔] => ⪔
|
||||
[𝔤] => 𝔤
|
||||
[≫] => ≫
|
||||
|
@ -841,7 +841,7 @@ Array
|
|||
[⥸] => ⥸
|
||||
[⋗] => ⋗
|
||||
[⋛] => ⋛
|
||||
[≩︀] => &gvertneqq
|
||||
[≩︀] => ≩︀
|
||||
[⇔] => ⇔
|
||||
[ ] =>  
|
||||
[½] => ½
|
||||
|
@ -940,7 +940,7 @@ Array
|
|||
[⪫] => ⪫
|
||||
[⤙] => ⤙
|
||||
[⪭] => ⪭
|
||||
[⪭︀] => &lates
|
||||
[⪭︀] => ⪭︀
|
||||
[⤌] => ⤌
|
||||
[❲] => ❲
|
||||
[{] => {
|
||||
|
@ -965,7 +965,7 @@ Array
|
|||
[⩿] => ⩿
|
||||
[⪁] => ⪁
|
||||
[⪃] => ⪃
|
||||
[⋚︀] => &lesg
|
||||
[⋚︀] => ⋚︀
|
||||
[⪓] => ⪓
|
||||
[⋖] => ⋖
|
||||
[⋚] => ⋚
|
||||
|
@ -1022,7 +1022,7 @@ Array
|
|||
[◃] => ◃
|
||||
[⥊] => ⥊
|
||||
[⥦] => ⥦
|
||||
[≨︀] => &lvertneqq
|
||||
[≨︀] => ≨︀
|
||||
[∺] => ∺
|
||||
[¯] => ¯
|
||||
[♂] => ♂
|
||||
|
@ -1046,42 +1046,42 @@ Array
|
|||
[𝓂] => 𝓂
|
||||
[μ] => μ
|
||||
[⊸] => ⊸
|
||||
[⋙̸] => &nGg
|
||||
[≫⃒] => &nGt
|
||||
[⋙̸] => ⋙̸
|
||||
[≫⃒] => ≫⃒
|
||||
[⇍] => ⇍
|
||||
[⋘̸] => &nLl
|
||||
[≪⃒] => &nLt
|
||||
[≪̸] => &nLtv
|
||||
[⋘̸] => ⋘̸
|
||||
[≪⃒] => ≪⃒
|
||||
[≪̸] => ≪̸
|
||||
[⊯] => ⊯
|
||||
[⊮] => ⊮
|
||||
[∇] => ∇
|
||||
[ń] => ń
|
||||
[∠⃒] => &nang
|
||||
[⩰̸] => &napE
|
||||
[≋̸] => &napid
|
||||
[∠⃒] => ∠⃒
|
||||
[⩰̸] => ⩰̸
|
||||
[≋̸] => ≋̸
|
||||
[ʼn] => ʼn
|
||||
[≉] => ≉
|
||||
[♮] => ♮
|
||||
[ℕ] => ℕ
|
||||
[ ] =>
|
||||
[≎̸] => &nbump
|
||||
[≏̸] => &nbumpe
|
||||
[≎̸] => ≎̸
|
||||
[≏̸] => ≏̸
|
||||
[⩃] => ⩃
|
||||
[ň] => ň
|
||||
[ņ] => ņ
|
||||
[≇] => ≇
|
||||
[⩭̸] => &ncongdot
|
||||
[⩭̸] => ⩭̸
|
||||
[⩂] => ⩂
|
||||
[н] => н
|
||||
[–] => –
|
||||
[⇗] => ⇗
|
||||
[⤤] => ⤤
|
||||
[≐̸] => &nedot
|
||||
[≂̸] => &nesim
|
||||
[≐̸] => ≐̸
|
||||
[≂̸] => ≂̸
|
||||
[∄] => ∄
|
||||
[𝔫] => 𝔫
|
||||
[≱] => ≱
|
||||
[⩾̸] => &nges
|
||||
[⩾̸] => ⩾̸
|
||||
[≵] => ≵
|
||||
[≯] => ≯
|
||||
[⇎] => ⇎
|
||||
|
@ -1089,41 +1089,41 @@ Array
|
|||
[⋼] => ⋼
|
||||
[⋺] => ⋺
|
||||
[њ] => њ
|
||||
[≦̸] => &nlE
|
||||
[≦̸] => ≦̸
|
||||
[‥] => ‥
|
||||
[↚] => ↚
|
||||
[↮] => ↮
|
||||
[⩽̸] => &nles
|
||||
[⩽̸] => ⩽̸
|
||||
[≴] => ≴
|
||||
[⋪] => ⋪
|
||||
[⋬] => ⋬
|
||||
[𝕟] => 𝕟
|
||||
[¬] => ¬
|
||||
[∉] => ∉
|
||||
[⋹̸] => ¬inE
|
||||
[⋵̸] => ¬indot
|
||||
[⋹̸] => ⋹̸
|
||||
[⋵̸] => ⋵̸
|
||||
[⋷] => ⋷
|
||||
[⋶] => ⋶
|
||||
[∌] => ∌
|
||||
[⋾] => ⋾
|
||||
[⋽] => ⋽
|
||||
[∦] => ∦
|
||||
[⫽⃥] => &nparsl
|
||||
[∂̸] => &npart
|
||||
[⫽⃥] => ⫽⃥
|
||||
[∂̸] => ∂̸
|
||||
[⨔] => ⨔
|
||||
[⊀] => ⊀
|
||||
[⇏] => ⇏
|
||||
[↛] => ↛
|
||||
[⤳̸] => &nrarrc
|
||||
[↝̸] => &nrarrw
|
||||
[⤳̸] => ⤳̸
|
||||
[↝̸] => ↝̸
|
||||
[𝓃] => 𝓃
|
||||
[∤] => ∤
|
||||
[≄] => ≄
|
||||
[⊄] => ⊄
|
||||
[⫅̸] => &nsubE
|
||||
[⫅̸] => ⫅̸
|
||||
[⊅] => ⊅
|
||||
[⊃⃒] => &nsupset
|
||||
[⫆̸] => &nsupseteqq
|
||||
[⊃⃒] => ⊃⃒
|
||||
[⫆̸] => ⫆̸
|
||||
[ñ] => ñ
|
||||
[≸] => ≸
|
||||
[⋫] => ⋫
|
||||
|
@ -1133,18 +1133,18 @@ Array
|
|||
[ ] =>  
|
||||
[⊭] => ⊭
|
||||
[⤄] => ⤄
|
||||
[≍⃒] => &nvap
|
||||
[≍⃒] => ≍⃒
|
||||
[⊬] => ⊬
|
||||
[≥⃒] => &nvge
|
||||
[>⃒] => &nvgt
|
||||
[≥⃒] => ≥⃒
|
||||
[>⃒] => >⃒
|
||||
[⧞] => ⧞
|
||||
[⤂] => ⤂
|
||||
[≤⃒] => &nvle
|
||||
[<⃒] => &nvlt
|
||||
[⊴⃒] => &nvltrie
|
||||
[≤⃒] => ≤⃒
|
||||
[<⃒] => <⃒
|
||||
[⊴⃒] => ⊴⃒
|
||||
[⤃] => ⤃
|
||||
[⊵⃒] => &nvrtrie
|
||||
[∼⃒] => &nvsim
|
||||
[⊵⃒] => ⊵⃒
|
||||
[∼⃒] => ∼⃒
|
||||
[⇖] => ⇖
|
||||
[⤣] => ⤣
|
||||
[↖] => ↖
|
||||
|
@ -1254,7 +1254,7 @@ Array
|
|||
[⇛] => ⇛
|
||||
[⤜] => ⤜
|
||||
[⥤] => ⥤
|
||||
[∽̱] => &race
|
||||
[∽̱] => ∽̱
|
||||
[ŕ] => ŕ
|
||||
[⦳] => ⦳
|
||||
[⦒] => ⦒
|
||||
|
@ -1364,7 +1364,7 @@ Array
|
|||
[⌣] => ⌣
|
||||
[⪪] => ⪪
|
||||
[⪬] => ⪬
|
||||
[⪬︀] => &smtes
|
||||
[⪬︀] => ⪬︀
|
||||
[ь] => ь
|
||||
[/] => /
|
||||
[⧄] => ⧄
|
||||
|
@ -1372,9 +1372,9 @@ Array
|
|||
[𝕤] => 𝕤
|
||||
[♠] => ♠
|
||||
[⊓] => ⊓
|
||||
[⊓︀] => &sqcaps
|
||||
[⊓︀] => ⊓︀
|
||||
[⊔] => ⊔
|
||||
[⊔︀] => &sqcups
|
||||
[⊔︀] => ⊔︀
|
||||
[⊏] => ⊏
|
||||
[⊐] => ⊐
|
||||
[▪] => ▪
|
||||
|
@ -1501,7 +1501,7 @@ Array
|
|||
[⫩] => ⫩
|
||||
[⦜] => ⦜
|
||||
[ϰ] => ϰ
|
||||
[⫌︀] => &varsupsetneqq
|
||||
[⫌︀] => ⫌︀
|
||||
[⊲] => ⊲
|
||||
[в] => в
|
||||
[⊢] => ⊢
|
||||
|
@ -1510,13 +1510,13 @@ Array
|
|||
[⋮] => ⋮
|
||||
[|] => |
|
||||
[𝔳] => 𝔳
|
||||
[⊂⃒] => &vnsub
|
||||
[⊂⃒] => ⊂⃒
|
||||
[𝕧] => 𝕧
|
||||
[⊳] => ⊳
|
||||
[𝓋] => 𝓋
|
||||
[⫋︀] => &vsubnE
|
||||
[⊊︀] => &vsubne
|
||||
[⊋︀] => &vsupne
|
||||
[⫋︀] => ⫋︀
|
||||
[⊊︀] => ⊊︀
|
||||
[⊋︀] => ⊋︀
|
||||
[⦚] => ⦚
|
||||
[ŵ] => ŵ
|
||||
[⩟] => ⩟
|
||||
|
|
|
@ -81,7 +81,7 @@ Array
|
|||
[^] => ^
|
||||
[_] => _
|
||||
[`] => `
|
||||
[fj] => &fjlig
|
||||
[fj] => fj
|
||||
[{] => {
|
||||
[|] => |
|
||||
[}] => }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue