[Pkg-php-commits] [php/debian-sid] Cherry pick patch to fix SplFileInfo::getPathName()
Raphael Geissert
geissert at debian.org
Sat May 1 19:21:42 UTC 2010
---
debian/patches/series | 1 +
.../upstream/SplFileInfo_getPathName_parent.patch | 40 ++++++++++++++++++++
2 files changed, 41 insertions(+), 0 deletions(-)
create mode 100644 debian/patches/upstream/SplFileInfo_getPathName_parent.patch
diff --git a/debian/patches/series b/debian/patches/series
index 314001b..82c602b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -56,3 +56,4 @@ use_system_crypt_fixes.patch
upstream/mysqli_ssl.patch
upstream/pdo_reset_error_beginTransaction.patch
upstream/define_json_error_utf8.patch
+upstream/SplFileInfo_getPathName_parent.patch
diff --git a/debian/patches/upstream/SplFileInfo_getPathName_parent.patch b/debian/patches/upstream/SplFileInfo_getPathName_parent.patch
new file mode 100644
index 0000000..037e332
--- /dev/null
+++ b/debian/patches/upstream/SplFileInfo_getPathName_parent.patch
@@ -0,0 +1,40 @@
+Description: SplFileInfo::getPathName() should return the parent
+ directory name.
+Origin: http://svn.php.net/viewvc?view=revision&revision=298647
+Last-Update: 2010-05-01
+
+Index: php/ext/spl/spl_directory.c
+===================================================================
+--- php.orig/ext/spl/spl_directory.c
++++ php/ext/spl/spl_directory.c
+@@ -1178,7 +1178,10 @@ SPL_METHOD(SplFileInfo, getPathInfo)
+ int path_len;
+ char *path = spl_filesystem_object_get_pathname(intern, &path_len TSRMLS_CC);
+ if (path) {
+- spl_filesystem_object_create_info(intern, path, path_len, 1, ce, return_value TSRMLS_CC);
++ char *dpath = estrndup(path, path_len);
++ path_len = php_dirname(dpath, path_len);
++ spl_filesystem_object_create_info(intern, dpath, path_len, 1, ce, return_value TSRMLS_CC);
++ efree(dpath);
+ }
+ }
+
+Index: php/ext/spl/tests/bug48361.phpt
+===================================================================
+--- /dev/null
++++ php/ext/spl/tests/bug48361.phpt
+@@ -0,0 +1,14 @@
++--TEST--
++SPL: Bug #48361 SpleFileInfo::getPathName should return the dirname's path
++--FILE--
++<?php
++$info = new SplFileInfo(__FILE__);
++var_dump($info->getRealPath());
++var_dump($info->getPathInfo()->getRealPath());
++?>
++===DONE===
++--EXPECTF--
++string(%d) "%stests%sbug48361.php"
++string(%d) "%stests"
++===DONE===
++
--
1.6.5
More information about the Pkg-php-commits
mailing list