Skip to content

Commit f572f00

Browse files
authored
Downgrade IDREF errors to warnings in translations (#303)
1 parent 41b6057 commit f572f00

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

configure.php

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,19 +1012,28 @@ function xml_validate_jing()
10121012
$cmdJing = "java -Djdk.xml.totalEntitySizeLimit=300000 -jar {$srcdir}/docbook/jing.jar {$schema} {$idempath}";
10131013
exec( $cmdJing , $out , $ret );
10141014

1015+
if ( ! is_array( $out ) )
1016+
$out = [];
1017+
10151018
if ( $ret == 0 )
10161019
{
10171020
echo "done.\n";
10181021
return;
10191022
}
1020-
else
1021-
{
1022-
echo "failed.\n";
1023-
if ( is_array( $out ) )
1024-
foreach ( $out as $line )
1025-
echo "$line\n";
1023+
1024+
echo "failed.\n";
1025+
foreach ( $out as $line )
1026+
echo "$line\n";
1027+
1028+
// Allow translations with missing/mismatched IDREFs to continue building.
1029+
1030+
$countFatal = count( $out );
1031+
foreach ( $out as $line )
1032+
if ( preg_match( '/IDREF "[^"]+" without matching ID/', $line ) )
1033+
$countFatal--;
1034+
1035+
if ( $GLOBALS['ac']['LANG'] === 'en' || $countFatal > 0 )
10261036
errors_are_bad( 1 );
1027-
}
10281037
}
10291038

10301039
function xml_validate_libxml( $dom )

0 commit comments

Comments
 (0)