Skip to content

Commit 24ec008

Browse files
alfsbAndré L F S Bacci
andauthored
Make XPonter evaluation failure a hard error. (#99)
Co-authored-by: André L F S Bacci <[email protected]>
1 parent e764219 commit 24ec008

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

configure.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ function print_xml_errors($details = true) {
210210
$output = ( $ac['STDERR_TO_STDOUT'] == 'yes' ) ? STDOUT : STDERR;
211211
if ($errors && count($errors) > 0) {
212212
foreach($errors as $err) {
213+
if ($ac['LANG'] != 'en' && // translations
214+
$ac['XPOINTER_REPORTING'] != 'yes' && // can disable
215+
strncmp($err->message, 'XPointer evaluation failed:', 27) == 0) {
216+
continue;
217+
}
213218
$errmsg = wordwrap(" " . trim($err->message), 80, "\n ");
214219
if ($details && $err->file) {
215220
$file = file(urldecode($err->file)); // libxml appears to urlencode() its errors strings
@@ -720,19 +725,22 @@ function generate_sources_file() // {{{
720725
echo "done.\n";
721726

722727
echo "Running XInclude/XPointer... ";
723-
flush();
724-
725728
$dom->xinclude();
726-
727729
echo "done.\n";
728730
flush();
729731

730-
if ( $ac['XPOINTER_REPORTING'] == 'yes' || ($ac['LANG'] == 'en') )
732+
if ( $ac['XPOINTER_REPORTING'] == 'yes' || $ac['LANG'] == 'en' )
731733
{
732734
$errors = libxml_get_errors();
733735
$output = ( $ac['STDERR_TO_STDOUT'] == 'yes' ) ? STDOUT : STDERR;
734-
foreach( $errors as $error )
735-
fprintf( $output , "{$error->message}\n");
736+
if ( count( $errors ) > 0 )
737+
{
738+
fprintf( $output , "\n");
739+
foreach( $errors as $error )
740+
fprintf( $output , "{$error->message}\n");
741+
if ( $ac['LANG'] == 'en' )
742+
errors_are_bad(1);
743+
}
736744
}
737745

738746
echo "Validating {$ac["INPUT_FILENAME"]}... ";

0 commit comments

Comments
 (0)