summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-5.3.16-62715.patch49
-rw-r--r--php53.spec10
2 files changed, 58 insertions, 1 deletions
diff --git a/php-5.3.16-62715.patch b/php-5.3.16-62715.patch
new file mode 100644
index 0000000..1b0d359
--- /dev/null
+++ b/php-5.3.16-62715.patch
@@ -0,0 +1,49 @@
+From 49b202f2cfe04d577671b685b7c0d3a096a433c7 Mon Sep 17 00:00:00 2001
+From: Xinchen Hui <laruence@php.net>
+Date: Thu, 2 Aug 2012 22:16:46 +0800
+Subject: [PATCH] Fixed bug that can not get default value of parameter if
+ it's not `optional`
+
+---
+ ext/reflection/php_reflection.c | 4 ----
+ ext/reflection/tests/bug62715.phpt | 7 +++++++
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
+index 23c9044..593a050 100644
+--- a/ext/reflection/php_reflection.c
++++ b/ext/reflection/php_reflection.c
+@@ -2406,10 +2406,6 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
+ zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions");
+ return;
+ }
+- if (param->offset < param->required) {
+- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional");
+- return;
+- }
+ precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
+ if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == IS_UNUSED) {
+ zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error");
+diff --git a/ext/reflection/tests/bug62715.phpt b/ext/reflection/tests/bug62715.phpt
+index 721d484..feb67f6 100644
+--- a/ext/reflection/tests/bug62715.phpt
++++ b/ext/reflection/tests/bug62715.phpt
+@@ -10,8 +10,15 @@ foreach ($r->getParameters() as $p) {
+ var_dump($p->isDefaultValueAvailable());
+ }
+
++foreach ($r->getParameters() as $p) {
++ if ($p->isDefaultValueAvailable()) {
++ var_dump($p->getDefaultValue());
++ }
++}
+ ?>
+ --EXPECT--
+ bool(true)
+ bool(true)
+ bool(false)
++NULL
++int(0)
+--
+1.7.8
+
diff --git a/php53.spec b/php53.spec
index 4ad6fa5..56f37ef 100644
--- a/php53.spec
+++ b/php53.spec
@@ -46,7 +46,7 @@
Summary: PHP scripting language for creating dynamic web sites
Name: %{phpname}
Version: 5.3.16
-Release: 3%{?dist}
+Release: 4%{?dist}
License: PHP
Group: Development/Languages
URL: http://www.php.net/
@@ -110,6 +110,10 @@ Patch93: php-5.3.9-mysqli.patch
# http://svn.php.net/viewvc?view=revision&revision=300791
Patch94: php-5.3.7-pdo-dblib-50755.patch
+# real fix for https://bugs.php.net/62715
+# http://git.php.net/?p=php-src.git;a=commitdiff;h=49b202f2cfe04d577671b685b7c0d3a096a433c7
+Patch95: php-5.3.16-62715.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -713,6 +717,7 @@ echo CIBLE = %{name}-%{version}-%{release}
%patch93 -p1 -b .mysqli
%endif
%patch94 -p1 -b .50755
+%patch95 -p1 -b .62715
# Prevent %%doc confusion over LICENSE files
@@ -1496,6 +1501,9 @@ fi
%endif
%changelog
+* Tue Sep 12 2012 Remi Collet <remi@fedoraproject.org> 5.3.16-4
+- add upstream patch for https://bugs.php.net/62715
+
* Tue Sep 4 2012 Remi Collet <remi@fedoraproject.org> 5.3.16-3
- use system pcre only on fedora >= 14 (version 8.10)