[PHP-BUG] Bug #61469 [NEW]: simplexml_load_file() url encodes file names if they use a stream wrapper

2012-03-21 Thread saschagros at gmail dot com
From: 
Operating system: Linux/Windows
PHP version:  5.3.10
Package:  SimpleXML related
Bug Type: Bug
Bug description:simplexml_load_file() url encodes file names if they use a 
stream wrapper

Description:

Drupal uses custom stream wrappers for accessing files.

Given the file name "$imported_file = 'temporary://translated file.xlf'",
the following does not work:

$xml = simplexml_load_file($imported_file);

It results in the following warning:
simplexml_load_file(): I/O warning : failed to load external entity
"temporary://translated%20file.xlf"

However, this works just fine:

$xml_string = file_get_contents($imported_file);
$xml = simplexml_load_string($xml_string);


-- 
Edit bug report at https://bugs.php.net/bug.php?id=61469&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=61469&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=61469&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=61469&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=61469&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61469&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=61469&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=61469&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=61469&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=61469&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=61469&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=61469&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=61469&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=61469&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=61469&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=61469&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=61469&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=61469&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=61469&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=61469&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=61469&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=61469&r=mysqlcfg



Bug #61469 [Com]: simplexml_load_file() url encodes file names if they use a stream wrapper

2012-03-22 Thread saschagros at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=61469&edit=1

 ID: 61469
 Comment by: saschagros at gmail dot com
 Reported by:saschagros at gmail dot com
 Summary:simplexml_load_file() url encodes file names if they
 use a stream wrapper
 Status: Not a bug
 Type:   Bug
 Package:SimpleXML related
 Operating System:   Linux/Windows
 PHP Version:5.3.10
 Block user comment: N
 Private report: N

 New Comment:

temporary is not a remote URI that points to a HTTP resource. This is a local 
file.

If the space needs to be encoded internally, fine. But it has to be possible to 
access a file with a space in it using a stream wrapper? After all, 
file_get_contents() works just fine.


Previous Comments:

[2012-03-22 07:35:40] cataphr...@php.net

Looks right. URIs cannot contain spaces. See RFC 3986.


[2012-03-21 22:43:03] saschagros at gmail dot com

Description:

Drupal uses custom stream wrappers for accessing files.

Given the file name "$imported_file = 'temporary://translated file.xlf'", the 
following does not work:

$xml = simplexml_load_file($imported_file);

It results in the following warning:
simplexml_load_file(): I/O warning : failed to load external entity 
"temporary://translated%20file.xlf"

However, this works just fine:

$xml_string = file_get_contents($imported_file);
$xml = simplexml_load_string($xml_string);







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61469&edit=1


#48773 [NEW]: Incorrect error when setting PDO::ATTR_STATEMENT_CLASS with ctor_args

2009-07-02 Thread saschagros at gmail dot com
From: saschagros at gmail dot com
Operating system: Linux
PHP version:  6CVS-2009-07-02 (snap)
PHP Bug Type: PDO related
Bug description:  Incorrect error when setting PDO::ATTR_STATEMENT_CLASS with 
ctor_args

Description:

I'm getting the following error when the ATTR_STATEMENT_CLASS option is
set...

Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format
array(classname, array(ctor_args)); the classname must be a string
specifying an existing class' in
/drupal7/includes/database/database.inc:338

The same configuration works for PHP 5.2 and 5.3

The reproduce code is the constructor of the DatabaseConnection class of
Drupal 7, see also
http://cvs.drupal.org/viewvc.py/drupal/drupal/includes/database/database.inc?revision=1.57&view=markup

Reproduce code:
---
  function __construct($dsn, $username, $password, $driver_options =
array()) {
// Because the other methods don't seem to work right.
$driver_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;

// Call PDO::__construct and PDO::setAttribute.
parent::__construct($dsn, $username, $password, $driver_options);

// Set a specific PDOStatement class if the driver requires that.
if (!empty($this->statementClass)) {
  $this->setAttribute(PDO::ATTR_STATEMENT_CLASS,
array($this->statementClass, array($this)));
}
  }


Expected result:

The connection can be established

Actual result:
--
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format
array(classname, array(ctor_args)); the classname must be a string
specifying an existing class' in
/drupal7/includes/database/database.inc:338
Stack trace:
#0 .../drupal7/includes/database/database.inc(338): PDO->setAttribute(13,
Array)
#1 .../drupal7/includes/database/mysql/database.inc(36):
DatabaseConnection->__construct('mysql:host=loca...', 'd7', 'd7', Array)
#2 /.../drupal7/includes/database/database.inc(1350):
DatabaseConnection_mysql->__construct(Array)
#3 .../drupal7/includes/database/database.inc(1218):
Database::openConnection('default', 'default')
#4 .../drupal7/includes/database/database.inc(1793):
Database::getConnection('default')
#5 .../drupal7/includes/bootstrap.inc(1242): db_query('SELECT 1 FROM
{...', Array)


-- 
Edit bug report at http://bugs.php.net/?id=48773&edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48773&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48773&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48773&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48773&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48773&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48773&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=48773&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=48773&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=48773&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=48773&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=48773&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=48773&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=48773&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48773&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=48773&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=48773&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=48773&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=48773&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=48773&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=48773&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=48773&r=mysqlcfg



#47714 [Com]: autoloading classes inside exception_handler leads to crashes

2009-03-25 Thread saschagros at gmail dot com
 ID:   47714
 Comment by:   saschagros at gmail dot com
 Reported By:  crocodile2u at gmail dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Ubuntu 8.10
 PHP Version:  5.3.0beta1
 New Comment:

I can confirm this.

I am testing Drupal on PHP 5.3 and I am getting the same "Fatal error:
Exception
thrown without a stack frame in Unknown on line 0" in our
exception_handler test, because we creat a new object (to log
exceptions) in the exception handler function.


Previous Comments:


[2009-03-20 06:12:40] crocodile2u at gmail dot com

All the same with this snapshot. Both crashes remain.



[2009-03-20 00:56:24] fel...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2009-03-19 08:36:27] crocodile2u at gmail dot com

> The crash type depends on whether I use __autoload() or
> spl_autoload_register(). I the first case I get "Fatal error: 
> Exception
> thrown without a stack frame in Unknown on line 0", while in the 
> second
> I get "Fatal error: Allowed memory size of 134217728 bytes exhausted
> (tried to allocate 72 bytes) in /home/vbolshov/tmp/x.php on line 21
> Segmentation fault"

I am sorry but the error messages are mixed up here. 

Correct is:
for __autoload() - "Fatal error: Allowed memory size of 134217728 bytes
exhausted
(tried to allocate 72 bytes) in /home/vbolshov/tmp/x.php on line 21
Segmentation fault"
for spl_autoload_register(): "Fatal error: Exception
thrown without a stack frame in Unknown on line 0"



[2009-03-19 08:33:12] crocodile2u at gmail dot com

Description:

When I use set_exception_handler() and attempt to create an instance of
a class inside the handler (the class is not yet loaded and needs to be
loaded with __autoload) - I get crashes.

The crash type depends on whether I use __autoload() or
spl_autoload_register(). I the first case I get "Fatal error: Exception
thrown without a stack frame in Unknown on line 0", while in the second
I get "Fatal error: Allowed memory size of 134217728 bytes exhausted
(tried to allocate 72 bytes) in /home/vbolshov/tmp/x.php on line 21
Segmentation fault"

It must be noticed, that in case the class already had been loaded by
the moment of the exception throw - there are no errors and everything
is ok.

I am terribly sorry the the reproduce code is longer than 20 lines but
it is really simple and I think it shows all the problems.

Reproduce code:
---
getMessage()."\n";
}
}
*/

function au($class) {
eval('class handler {
  function handle($e) {
  echo $e->getMessage()."\n";
  }
  }');
}

/*
Uncomment __autoload() and comment spl_autoload_register() call to
switch between crash types
*/

/*
function __autoload($class) {
au($class);
}
*/

spl_autoload_register('au');

set_exception_handler(function($exception) {
$h = new handler();
$h->handle($exception);
});

throw new Exception('exception');

Expected result:

exception

Actual result:
--
In case we use spl_autoload_register:
--
Fatal error: Exception thrown without a stack frame in Unknown on line
0
--

In case we use __autoload:
--
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 72 bytes) in /home/vbolshov/tmp/x.php on line 21
Segmentation fault
--

Works ok when handler class declaration at the top is uncommented.





-- 
Edit this bug report at http://bugs.php.net/?id=47714&edit=1



#47772 [NEW]: filter_var() returnes nothing for some invalid e-mails

2009-03-25 Thread saschagros at gmail dot com
From: saschagros at gmail dot com
Operating system: Ubuntu 9.04 Jaunty
PHP version:  5.3.0RC1
PHP Bug Type: Filter related
Bug description:  filter_var() returnes nothing for some invalid e-mails

Description:

filter_var incorrectly validates some invalid e-mail adresses (see
reproduce code).

Note: I am not 100% sure that this is the wrong behavior, however, it has
changed from php 5.2 and I can't find a related bug or NEWS entry.

Reproduce code:
---
var_dump(filter_var('inva...@site', FILTER_VALIDATE_EMAIL));
var_dump(filter_var('inva...@site.', FILTER_VALIDATE_EMAIL));

Expected result:

bool(false)
bool(false)

Actual result:
--
string(13) "inva...@site."
string(12) "inva...@site"

-- 
Edit bug report at http://bugs.php.net/?id=47772&edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47772&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47772&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47772&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47772&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47772&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47772&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=47772&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=47772&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=47772&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=47772&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=47772&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=47772&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=47772&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47772&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=47772&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=47772&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=47772&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=47772&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=47772&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=47772&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=47772&r=mysqlcfg



#50818 [NEW]: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined

2010-01-21 Thread saschagros at gmail dot com
From: saschagros at gmail dot com
Operating system: Linux (Ubuntu)
PHP version:  6SVN-2010-01-22 (snap)
PHP Bug Type: PDO related
Bug description:  SQLSTATE[HY093]: Invalid parameter number: parameter was not 
defined

Description:

Once again trying to get Drupal to run with PHP 6.

I'm getting the following error on the first query that is run..

Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[HY093]: Invalid parameter number: parameter was not defined' in
.../drupal7/includes/database/database.inc:1941

That line looks like this:

Note: parent is PDOStatement.

The executed query:
unicode(87) "SELECT data, created, headers, expire, serialized FROM
cache_bootstrap WHERE cid = :cid"

$args contains:
array(1) {
  [u":cid"]=>
  unicode(9) "variables"
}

I would suspect that it does have something to do with unicode.


-- 
Edit bug report at http://bugs.php.net/?id=50818&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50818&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50818&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50818&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50818&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50818&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50818&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=50818&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=50818&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=50818&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=50818&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=50818&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=50818&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=50818&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50818&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=50818&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=50818&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=50818&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=50818&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=50818&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=50818&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=50818&r=mysqlcfg