mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
ext/mbstring: update UCD parser to accept characters with multiple properties
This commit is contained in:
parent
998997b6a1
commit
23f99f08c9
1 changed files with 12 additions and 4 deletions
|
@ -367,14 +367,22 @@ function parseSpecialCasing(UnicodeData $data, string $input) : void {
|
||||||
|
|
||||||
function parseDerivedCoreProperties(UnicodeData $data, string $input) : void {
|
function parseDerivedCoreProperties(UnicodeData $data, string $input) : void {
|
||||||
foreach (parseDataFile($input) as $fields) {
|
foreach (parseDataFile($input) as $fields) {
|
||||||
if (count($fields) != 2) {
|
$fieldCount = count($fields);
|
||||||
throw new Exception("Line does not contain 2 fields");
|
if ($fieldCount != 2 && $fieldCount !== 3) {
|
||||||
|
throw new Exception("Line does not contain 2 or 3 fields");
|
||||||
}
|
}
|
||||||
|
|
||||||
$property = $fields[1];
|
$usedProperties = ['Cased', 'Case_Ignorable'];
|
||||||
if ($property != 'Cased' && $property != 'Case_Ignorable') {
|
if (isset($fields[2]) && in_array($fields[2], $usedProperties, true)) {
|
||||||
|
$property = $fields[2];
|
||||||
|
}
|
||||||
|
elseif (!in_array($fields[1], $usedProperties, true)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$property = $fields[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$range = explode('..', $fields[0]);
|
$range = explode('..', $fields[0]);
|
||||||
if (count($range) == 2) {
|
if (count($range) == 2) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue