#39881 [NEW]: document() function failing for long names in path

From: Date: Tue, 19 Dec 2006 11:03:47 +0000
Subject: #39881 [NEW]: document() function failing for long names in path
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106609@lists.php.net to get a copy of this message
From: dashiad at hotmail dot com Operating system: Windows XP Professional PHP version: 5.2.0 PHP Bug Type: XSLT related Bug description: document() function failing for long names in path Description: ------------ Hello, something strange is happening with the document() XSL function, and long directory (+8 characters) names. Scenarios: - Passing a non-existent file path to document() (no long names): Warning issued ("failed to load external entity") (Normal behaviour) - Passing an existent or non-existent file path to document() , using long names: No warning, and, if the file exists, nothing is fetched. - Passing an existent file path to document, using MSDOS equivalent to long names: Everything works as it should.Warning, or success. This is, i have to change: "C:/Archivos de programa/Apache Group/Apache/htdocs/test.xml" to "C:/Archiv~1/Apache~1/Apache/htdocs/test.xml" to make it work. Havent tested if the problem is still there if is the xml filename the one with long name. Following is the reproduce code: Reproduce code: --------------- /* PHP FILE.The path should be changed as needed.There are two lines, one with long and other with short names. */ <? $xml='<?xml version="1.0"?><b></b>'; $xsl='<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >'. '<xsl:template match="/">'. // '<xsl:copy-of select="document(\'C:/Archivos de programa/Apache Group/Apache/htdocs/test.xml\')" />'. '<xsl:copy-of select="document(\'c:/Archiv~1/Apache~1/Apache/htdocs/test.xml\')" />'. '</xsl:template></xsl:stylesheet>'; $xmlDoc=new DOMDocument(); $xmlDoc->loadXML($xml); $xslDoc=new DOMDocument(); $xslDoc->loadXML($xsl); $proc = new XSLTProcessor; $proc->importStyleSheet($xslDoc); // attach the xsl rules echo $proc->transformToXML($xmlDoc) ?> /* Sample test.xml (external entity).Could be whatever.*/ <?xml version="1.0"?> <z> <q> </q> </z> Expected result: ---------------- For clarity, i've not added xml headers.The expected result (using short names,it works): <?xml version="1.0"?> <z> <q> </q> </z> Actual result: -------------- When using long names... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD> <BODY></BODY></HTML> (ie:nothing) -- Edit bug report at http://bugs.php.net/?id=39881&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39881&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39881&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39881&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39881&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39881&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39881&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39881&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39881&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39881&r=support Expected behavior: http://bugs.php.net/fix.php?id=39881&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39881&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39881&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39881&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39881&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39881&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39881&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39881&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39881&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39881&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39881&r=mysqlcfg

« previous php.bugs (#106609) next »