Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Anonymous function rewritten as static one to maintain compatibility with PHP 5.2 #293

Merged
merged 1 commit into from
Mar 7, 2014

Conversation

mhujer
Copy link
Contributor

@mhujer mhujer commented Mar 7, 2014

Fixes #292

@Ocramius
Copy link
Member

Ocramius commented Mar 7, 2014

@mhujer I know this is kinda urgent, but it doesn't look like the tests pass on 5.2: https://travis-ci.org/zendframework/zf1/jobs/20264719#L1408

The build will most probably fail anyway because of missing phar

@mhujer
Copy link
Contributor Author

mhujer commented Mar 7, 2014

No, build on PHP 5.2 for release tag failed mainly because of this anonymous function called from many ZF classes. (It passed before recent security fixes: https://travis-ci.org/zendframework/zf1/builds)
The error in Zend/Xml is not appearing on other versions. But I dare say, that it was there before my fix, but not visible: https://travis-ci.org/zendframework/zf1/jobs/20225723#L1068

Executing Zend/Xml/AllTests.php
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home/travis/build/zendframework/zf1/library/Zend/Xml/Security.php on line 76
Finished executing Zend/Xml/AllTests.php

@Ocramius
Copy link
Member

Ocramius commented Mar 7, 2014

@mhujer yeah, the fatal is obvious. Looking into the failing test...

froschdesign added a commit that referenced this pull request Mar 7, 2014
Fixes #292 - Anonymous function rewritten as static one to maintain compatibility with PHP 5.2
@froschdesign froschdesign merged commit abc9a8e into zendframework:master Mar 7, 2014
@mhujer mhujer deleted the fix-anonymous-f branch March 7, 2014 07:31
}
return false;
}, E_WARNING);
set_error_handler(array('Zend_Xml_Security', '_loadXmlErrorHandler'), E_WARNING);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this can possibly work if _loadXmlErrorHandler is declared with protected visibility. Going to push through an update that makes it public.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

weierophinney added a commit that referenced this pull request Mar 7, 2014
- Since it's being invoked as a static callback, the method needs to be
  public. Renamed to remove the underscore prefix, and marked as public.
weierophinney added a commit that referenced this pull request Mar 7, 2014
- Prior to 5.3, you needed to cast a simplexml node to a scalar in order
  to do comparisons.
weierophinney added a commit that referenced this pull request Mar 7, 2014
- Discovered on installing PHPUnit to run tests that .gitignore was not setup to
  ignore composer.lock, nor the files installed in the bin/ directory.
weierophinney added a commit that referenced this pull request Mar 7, 2014
Fixes issues seen in #293
@weierophinney weierophinney added this to the 1.12.5 milestone Mar 7, 2014
xopherdeep pushed a commit to xopherdeep/Zend-Framework-v1 that referenced this pull request Jul 3, 2014
- Since it's being invoked as a static callback, the method needs to be
  public. Renamed to remove the underscore prefix, and marked as public.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

parse error, expecting `')'' in C:\wamp\zend\ZendFramework-1.12.4\library\Zend\Xml\Security.php on line 76
4 participants