php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38218 php:functionString tries to access objects with their names in lowercase
Submitted: 2006-07-26 08:47 UTC Modified: 2010-05-04 18:53 UTC
From: moksinski at gmail dot com Assigned: tony2001 (profile)
Status: Not a bug Package: XSLT related
PHP Version: 6CVS-2006-07-26 (snap) OS: windows 2000
Private report: No CVE-ID: None
 [2006-07-26 08:47 UTC] moksinski at gmail dot com
Description:
------------
php:functionString tries to access objects with their names in lowercase. when you use autoloader to include your classes it generates fatal error because it cannot find the proper php file.

Reproduce code:
---------------
<?php //FILE AutoLoaded.php 
class AutoLoaded { public static function printText($text) { return $text; }} 
?>

<?php //FILE index.php
$xsl=<<<EOSTRING
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" xsl:extension-element-prefixes="php">
<xsl:template match="xml"><xsl:value-of select="php:functionString('AutoLoaded::printText',@dummy)" disable-output-escaping="yes"/>
</xsl:template></xsl:stylesheet>
EOSTRING;
$xml='<xml dummy="everything is ok"/>';
function __autoload($className) {
    echo $className."\n";
    static $classes = array('AutoLoaded'=>'AutoLoaded.php');
    require_once($classes[$className]);
}
$doc = new DOMDocument('1.0','utf-8'); $doc->loadxml($xml); $xslt = new DOMDocument(); $xslt->loadxml($xsl);
$proc = new XSLTProcessor(); $proc->registerPHPFunctions(); $proc->importStyleSheet($xslt);
$proc->transformToXML($doc);
?>

Expected result:
----------------
AutoLoaded

Actual result:
--------------
autoloaded
Fatal error: require_once() [function.require]: Failed opening required ....

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-26 08:53 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-07-26 11:27 UTC] moksinski at gmail dot com
php6.0-win32-200607260830 generates the same error
php5.2-win32-200607261030 - works fine
 [2006-07-26 11:48 UTC] chregu@php.net
zend_make_callable() does a lowercase in PHP 6, which it 
didn't before

don't know, which part has to be fixed for this...
 [2006-07-26 11:59 UTC] tony2001@php.net
Obviously, the engine is not completely ready for Unicode.
I'll take a look at it.
 [2010-05-04 18:53 UTC] rrichards@php.net
-Status: Assigned +Status: Bogus
 [2010-05-04 18:53 UTC] rrichards@php.net
No longer an issue with new trunk
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC