Skip to content

Commit

Permalink
Setting documentURI cause fails on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
André L F S Bacci committed Jan 22, 2025
1 parent f2954ed commit 5191744
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -829,17 +829,9 @@ function xml_configure()

function dom_load( DOMDocument $dom , string $filename , string $baseURI = "" ) : bool
{
static $documentURI = "";
if ( $baseURI != "" )
$documentURI = $baseURI;

$filename = realpath( $filename );
$options = LIBXML_NOENT | LIBXML_COMPACT | LIBXML_BIGLINES | LIBXML_PARSEHUGE;
$ret = $dom->load( $filename , $options );

if ( $documentURI != "" )
$dom->documentURI = $documentURI;
return $ret;
return $dom->load( $filename , $options );
}

function dom_saveload( DOMDocument $dom , string $filename = "" ) : string
Expand All @@ -855,9 +847,8 @@ function dom_saveload( DOMDocument $dom , string $filename = "" ) : string

echo "Loading and parsing {$ac["INPUT_FILENAME"]}... ";
$dom = new DOMDocument();
$docpath = "{$ac['srcdir']}/{$ac["INPUT_FILENAME"]}";

if ( dom_load( $dom , $docpath , $docpath ) )
if ( dom_load( $dom , "{$ac['srcdir']}/{$ac["INPUT_FILENAME"]}" ) )
{
dom_saveload( $dom ); // correct file/line/column on error messages
echo "done.\n";
Expand Down

0 comments on commit 5191744

Please sign in to comment.