Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Imported Upstream version 5.3.5

  • Loading branch information...
commit 0963b802c03f76dd0ffb0cf5487e4ec55d74e191 1 parent 3ac0bcb
@oerdnj oerdnj authored
Showing with 17,465 additions and 11,803 deletions.
  1. +24 −12 INSTALL
  2. +1 −1  LICENSE
  3. +1 −0  Makefile.global
  4. +359 −3 NEWS
  5. +214 −87 TSRM/tsrm_virtual_cwd.c
  6. +14 −10 TSRM/tsrm_virtual_cwd.h
  7. +14 −1 UPGRADING
  8. +23 −0 UPGRADING.INTERNALS
  9. +2 −2 Zend/acinclude.m4
  10. +4 −4 Zend/tests/bug45180.phpt
  11. +4 −4 Zend/tests/bug45186.phpt
  12. +3 −3 Zend/tests/bug51176.phpt
  13. +35 −0 Zend/tests/bug52361.phpt
  14. +19 −0 Zend/tests/bug52484.phpt
  15. +19 −0 Zend/tests/bug52484_2.phpt
  16. +19 −0 Zend/tests/bug52484_3.phpt
  17. +20 −0 Zend/tests/bug52508.phpt
  18. +16 −0 Zend/tests/bug52879.phpt
  19. +40 −0 Zend/tests/bug52939.phpt
  20. +19 −0 Zend/tests/bug53305.phpt
  21. +10 −0 Zend/tests/bug53632.phpt
  22. +2 −2 Zend/tests/call_static_003.phpt
  23. +1 −1  Zend/tests/call_static_007.phpt
  24. +6 −0 Zend/tests/declare_001.phpt
  25. +40 −0 Zend/tests/gc_032.phpt
  26. BIN  Zend/tests/multibyte/multibyte_encoding_006.phpt
  27. +40 −0 Zend/tests/objects_032.phpt
  28. +1 −1  Zend/tests/unset_cv05.phpt
  29. +1 −1  Zend/tests/unset_cv06.phpt
  30. +2 −2 Zend/zend_API.c
  31. +12 −5 Zend/zend_compile.c
  32. +11 −3 Zend/zend_constants.c
  33. +7 −6 Zend/zend_exceptions.c
  34. +2 −2 Zend/zend_execute.c
  35. +3 −2 Zend/zend_execute_API.c
  36. +24 −20 Zend/zend_gc.c
  37. +4 −1 Zend/zend_hash.c
  38. +5 −5 Zend/zend_hash.h
  39. +1,224 −1,216 Zend/zend_ini_scanner.c
  40. +2 −2 Zend/zend_ini_scanner.l
  41. +1 −1  Zend/zend_ini_scanner_defs.h
  42. +6 −335 Zend/zend_language_scanner.c
  43. +5 −1 Zend/zend_language_scanner.l
  44. +1 −2  Zend/zend_language_scanner_defs.h
  45. +45 −11 Zend/zend_object_handlers.c
  46. +4 −6 Zend/zend_objects.c
  47. +2 −2 Zend/zend_strtod.c
  48. +12 −1 Zend/zend_variables.c
  49. +12 −1 Zend/zend_variables.h
  50. +44 −0 Zend/zend_vm_execute.h
  51. +21 −16 acinclude.m4
  52. +21 −16 aclocal.m4
  53. +3,002 −3,644 configure
  54. +6 −6 configure.in
  55. +5 −2 ext/bz2/bz2.c
  56. +10 −3 ext/calendar/calendar.c
  57. +12 −0 ext/calendar/tests/bug52744.phpt
  58. +8 −1 ext/com_dotnet/com_persist.c
  59. +17 −17 ext/curl/interface.c
  60. +1 −3 ext/curl/php_curl.h
  61. +16 −0 ext/curl/tests/bug52202.phpt
  62. +32 −0 ext/curl/tests/bug52827.phpt
  63. +6 −1 ext/curl/tests/curl_multi_getcontent_basic3.phpt
  64. +2 −2 ext/curl/tests/curl_multi_getcontent_error1.phpt
  65. +2 −2 ext/curl/tests/curl_multi_getcontent_error2.phpt
  66. +2 −2 ext/curl/tests/curl_multi_getcontent_error3.phpt
  67. +2 −2 ext/curl/tests/curl_multi_getcontent_error4.phpt
  68. +1 −1  ext/curl/tests/curl_setopt_basic001.phpt
  69. +1 −0  ext/curl/tests/curl_setopt_error.phpt
  70. +9 −3 ext/date/lib/parse_date.c
  71. +106 −100 ext/date/lib/parse_date.c.orig
  72. +8 −2 ext/date/lib/parse_date.re
  73. +2 −2 ext/date/lib/parse_iso_intervals.c
  74. +14 −3 ext/date/lib/timelib.c
  75. +2 −1  ext/date/lib/timelib.h
  76. +697 −636 ext/date/lib/timezonedb.h
  77. +2 −1  ext/date/lib/tm2unixtime.c
  78. +7 −1 ext/date/lib/unixtime2tm.c
  79. +33 −32 ext/date/php_date.c
  80. +7 −1 ext/date/php_date.h
  81. +18 −585 ext/date/tests/010.phpt
  82. +66 −166 ext/date/tests/DateTime_modify_variation1.phpt
  83. +17 −0 ext/date/tests/big_year.phpt
  84. +2 −2 ext/date/tests/bug33415-2.phpt
  85. +31 −0 ext/date/tests/bug46874.phpt
  86. +23 −0 ext/date/tests/bug52342.phpt
  87. +37 −0 ext/date/tests/bug52430.phpt
  88. +22 −0 ext/date/tests/bug52454.phpt
  89. +19 −0 ext/date/tests/bug52577.phpt
  90. +25 −0 ext/date/tests/bug52668.phpt
  91. +66 −166 ext/date/tests/date_modify_variation2.phpt
  92. +2 −2 ext/date/tests/timezone_abbreviations_list_basic1.phpt
  93. +2 −2 ext/dba/config.m4
  94. +1 −1  ext/dba/tests/dba_cdb_make.phpt
  95. +14 −0 ext/dom/tests/bug52656.phpt
  96. +2 −2 ext/dom/text.c
  97. +10 −2 ext/enchant/enchant.c
  98. +1 −1  ext/exif/tests/exif006.phpt
  99. +2 −2 ext/ext_skel
  100. +4 −1 ext/fileinfo/fileinfo.c
  101. +35 −14 ext/filter/logical_filters.c
  102. +38 −17 ext/filter/tests/030.phpt
  103. +1 −1  ext/filter/tests/bug39763.phpt
  104. +18 −0 ext/filter/tests/bug52929.phpt
  105. +17 −1 ext/gd/gd.c
  106. +4 −1 ext/gd/gd_ctx.c
  107. +32 −23 ext/gmp/gmp.c
  108. +5 −5 ext/gmp/tests/005.phpt
  109. +1 −1  ext/gmp/tests/040.phpt
  110. +5 −4 ext/gmp/tests/bug50283.phpt
  111. +46 −0 ext/gmp/tests/bug52906.phpt
  112. +1 −1  ext/gmp/tests/gmp_nextprime.phpt
  113. +2 −2 ext/hash/php_hash_tiger.h
  114. +43 −10 ext/iconv/iconv.c
  115. +29 −0 ext/iconv/tests/bug51250.phpt
  116. +41 −0 ext/iconv/tests/bug52941.phpt
  117. +13 −0 ext/iconv/tests/bug53304.phpt
  118. +1 −1  ext/iconv/tests/iconv_stream_filter_delimiter.phpt
  119. +11 −5 ext/imap/php_imap.c
  120. +3 −2 ext/interbase/config.w32
  121. +1 −0  ext/intl/dateformat/dateformat_attr.c
  122. +24 −2 ext/intl/dateformat/dateformat_format.c
  123. +7 −6 ext/intl/dateformat/dateformat_parse.c
  124. +7 −2 ext/intl/formatter/formatter_attr.c
  125. +13 −0 ext/intl/tests/bug50590.phpt
  126. +135 −3 ext/intl/tests/dateformat_format.phpt
  127. +7 −13 ext/intl/tests/dateformat_format_parse.phpt
  128. +6 −0 ext/intl/tests/dateformat_get_locale.phpt
  129. +2 −4 ext/intl/tests/dateformat_parse_timestamp_parsepos.phpt
  130. +6 −1 ext/intl/tests/formatter_get_set_symbol.phpt
  131. +2 −2 ext/json/json.c
  132. +8 −5 ext/ldap/config.w32
  133. +4 −0 ext/mbstring/libmbfl/mbfl/mbfilter.c
  134. +7 −5 ext/mbstring/mbstring.c
  135. +2 −2 ext/mbstring/tests/bug43301.phpt
  136. +26 −0 ext/mbstring/tests/bug52861.phpt
  137. +22 −0 ext/mbstring/tests/bug52931.phpt
  138. +23 −0 ext/mbstring/tests/bug52981.phpt
  139. +3 −6 ext/mbstring/tests/mb_decode_mimeheader_variation1.phpt
  140. +2 −2 ext/mbstring/tests/mb_send_mail01.phpt
  141. +2 −2 ext/mbstring/tests/mb_send_mail02.phpt
  142. +2 −2 ext/mbstring/tests/mb_send_mail03.phpt
  143. +2 −2 ext/mbstring/tests/mb_send_mail04.phpt
  144. +2 −2 ext/mbstring/tests/mb_send_mail05.phpt
  145. +2 −2 ext/mbstring/tests/mb_send_mail06.phpt
  146. +2 −2 ext/mbstring/tests/mb_send_mail07.phpt
  147. +31 −0 ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
  148. +47 −0 ext/mbstring/ucgendat/OPENLDAP_LICENSE
  149. +9 −0 ext/mbstring/ucgendat/README
  150. +1,985 −0 ext/mbstring/ucgendat/ucgendat.c
  151. +4,269 −2,735 ext/mbstring/unicode_data.h
  152. +10 −2 ext/mssql/php_mssql.c
  153. +82 −82 ext/mysql/php_mysql.c
  154. +2 −0  ext/mysql/tests/mysql_trace_mode.phpt
  155. +2 −1  ext/mysqli/config.m4
  156. +130 −69 ext/mysqli/mysqli.c
  157. +92 −67 ext/mysqli/mysqli_api.c
  158. +3 −3 ext/mysqli/mysqli_driver.c
  159. +3 −3 ext/mysqli/mysqli_embedded.c
  160. +3 −2 ext/mysqli/mysqli_exception.c
  161. +17 −12 ext/mysqli/mysqli_fe.c
  162. +135 −0 ext/mysqli/mysqli_fe.h
  163. +1 −1  ext/mysqli/mysqli_libmysql.h
  164. +52 −53 ext/mysqli/mysqli_nonapi.c
  165. +156 −0 ext/mysqli/mysqli_priv.h
  166. +39 −38 ext/mysqli/mysqli_prop.c
  167. +7 −5 ext/mysqli/mysqli_report.c
  168. +2 −2 ext/mysqli/mysqli_report.h
  169. +10 −9 ext/mysqli/mysqli_warning.c
  170. +1 −1  ext/mysqli/php_mysqli.h
  171. +11 −249 ext/mysqli/php_mysqli_structs.h
  172. +3 −3 ext/mysqli/tests/002.phpt
  173. +3 −3 ext/mysqli/tests/003.phpt
  174. +3 −3 ext/mysqli/tests/004.phpt
  175. +4 −4 ext/mysqli/tests/005.phpt
  176. +3 −3 ext/mysqli/tests/006.phpt
  177. +3 −3 ext/mysqli/tests/007.phpt
  178. +3 −3 ext/mysqli/tests/008.phpt
  179. +6 −6 ext/mysqli/tests/009.phpt
  180. +3 −3 ext/mysqli/tests/010.phpt
  181. +3 −3 ext/mysqli/tests/011.phpt
  182. +3 −3 ext/mysqli/tests/012.phpt
  183. +4 −4 ext/mysqli/tests/013.phpt
  184. +3 −3 ext/mysqli/tests/016.phpt
  185. +3 −3 ext/mysqli/tests/017.phpt
  186. +3 −3 ext/mysqli/tests/018.phpt
  187. +5 −5 ext/mysqli/tests/019.phpt
  188. +5 −5 ext/mysqli/tests/020.phpt
  189. +5 −5 ext/mysqli/tests/021.phpt
  190. +5 −5 ext/mysqli/tests/022.phpt
  191. +5 −5 ext/mysqli/tests/023.phpt
  192. +5 −5 ext/mysqli/tests/024.phpt
  193. +5 −5 ext/mysqli/tests/025.phpt
  194. +8 −8 ext/mysqli/tests/026.phpt
  195. +2 −2 ext/mysqli/tests/042.phpt
  196. +3 −3 ext/mysqli/tests/043.phpt
  197. +5 −5 ext/mysqli/tests/045.phpt
  198. +2 −2 ext/mysqli/tests/046.phpt
  199. +3 −3 ext/mysqli/tests/047.phpt
  200. +1 −1  ext/mysqli/tests/050.phpt
  201. +1 −1  ext/mysqli/tests/051.phpt
  202. +1 −1  ext/mysqli/tests/052.phpt
  203. +6 −6 ext/mysqli/tests/057.phpt
  204. +9 −9 ext/mysqli/tests/058.phpt
  205. +5 −5 ext/mysqli/tests/059.phpt
  206. +2 −2 ext/mysqli/tests/065.phpt
  207. +1 −1  ext/mysqli/tests/bug35759.phpt
  208. +160 −0 ext/mysqli/tests/bug52891.phpt
  209. +107 −0 ext/mysqli/tests/bug_mysql_49406.phpt
  210. +95 −0 ext/mysqli/tests/connect.inc
  211. +2 −2 ext/mysqli/tests/mysqli_change_user_set_names.phpt
  212. +12 −10 ext/mysqli/tests/mysqli_character_set.phpt
  213. +3 −3 ext/mysqli/tests/mysqli_character_set_name.phpt
  214. +2 −2 ext/mysqli/tests/mysqli_character_set_name_oo.phpt
  215. +1 −0  ext/mysqli/tests/mysqli_class_mysqli_interface.phpt
  216. +51 −0 ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt
  217. +6 −0 ext/mysqli/tests/mysqli_constants.phpt
  218. +46 −33 ext/mysqli/tests/mysqli_fetch_array_large.phpt
  219. +28 −10 ext/mysqli/tests/mysqli_fetch_field.phpt
  220. +24 −10 ext/mysqli/tests/mysqli_fetch_field_oo.phpt
  221. +21 −3 ext/mysqli/tests/mysqli_fetch_fields.phpt
  222. +20 −6 ext/mysqli/tests/mysqli_field_seek.phpt
  223. +79 −4 ext/mysqli/tests/mysqli_get_client_stats.phpt
  224. +8 −10 ext/mysqli/tests/mysqli_get_client_stats_off.phpt
  225. +2 −2 ext/mysqli/tests/mysqli_insert_packet_overflow.phpt
  226. +128 −0 ext/mysqli/tests/mysqli_magic_quotes.phpt
  227. +51 −40 ext/mysqli/tests/mysqli_options.phpt
  228. +109 −0 ext/mysqli/tests/mysqli_options_int_and_float_native.phpt
  229. +0 −3  ext/mysqli/tests/mysqli_pconn_conn_multiple.phpt
  230. +0 −3  ext/mysqli/tests/mysqli_pconn_disabled.phpt
  231. +0 −2  ext/mysqli/tests/mysqli_pconn_kill.phpt
  232. +0 −3  ext/mysqli/tests/mysqli_pconn_limits.phpt
  233. +13 −9 ext/mysqli/tests/mysqli_pconn_max_links.phpt
  234. +0 −3  ext/mysqli/tests/mysqli_pconn_reuse.phpt
  235. +0 −2  ext/mysqli/tests/mysqli_pconn_twice.phpt
  236. +0 −3  ext/mysqli/tests/mysqli_pconnect.phpt
  237. +5 −5 ext/mysqli/tests/mysqli_prepare.phpt
  238. +1 −1  ext/mysqli/tests/mysqli_set_charset.phpt
  239. +6 −0 ext/mysqli/tests/mysqli_stmt_attr_set.phpt
  240. +1 −1  ext/mysqli/tests/mysqli_stmt_bind_param.phpt
  241. +1 −0  ext/mysqli/tests/mysqli_stmt_bind_param_check_param_no_change.phpt
  242. +1 −1  ext/mysqli/tests/mysqli_stmt_bind_result.phpt
  243. +1 −1  ext/mysqli/tests/mysqli_stmt_fetch.phpt
  244. +30 −12 ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt
  245. +3 −3 ext/mysqli/tests/mysqli_stmt_num_rows.phpt
  246. +1 −1  ext/mysqli/tests/mysqli_stmt_param_count.phpt
  247. +1 −1  ext/mysqli/tests/mysqli_stmt_result_metadata.phpt
  248. +1 −1  ext/mysqli/tests/mysqli_stmt_send_long_data.phpt
  249. +3 −6 ext/mysqlnd/config9.m4
  250. +61 −69 ext/mysqlnd/mysqlnd.c
  251. +7 −9 ext/mysqlnd/mysqlnd.h
  252. +1 −2  ext/mysqlnd/mysqlnd_block_alloc.c
  253. +205 −220 ext/mysqlnd/mysqlnd_charset.c
  254. +189 −29 ext/mysqlnd/mysqlnd_debug.c
  255. +67 −14 ext/mysqlnd/mysqlnd_debug.h
  256. +24 −9 ext/mysqlnd/mysqlnd_enum_n_def.h
  257. +5 −3 ext/mysqlnd/mysqlnd_loaddata.c
  258. +3 −6 ext/mysqlnd/mysqlnd_net.c
  259. +6 −6 ext/mysqlnd/mysqlnd_portability.h
  260. +20 −5 ext/mysqlnd/mysqlnd_priv.h
  261. +80 −50 ext/mysqlnd/mysqlnd_ps.c
  262. +137 −74 ext/mysqlnd/mysqlnd_ps_codec.c
  263. +112 −78 ext/mysqlnd/mysqlnd_result.c
  264. +12 −13 ext/mysqlnd/mysqlnd_result_meta.c
  265. +10 −8 ext/mysqlnd/mysqlnd_statistics.c
  266. +2 −2 ext/mysqlnd/mysqlnd_statistics.h
  267. +11 −6 ext/mysqlnd/mysqlnd_structs.h
  268. +58 −47 ext/mysqlnd/mysqlnd_wireprotocol.c
  269. +2 −2 ext/mysqlnd/mysqlnd_wireprotocol.h
  270. +5 −3 ext/mysqlnd/php_mysqlnd.c
  271. +8 −16 ext/oci8/oci8.c
  272. +22 −12 ext/oci8/oci8_interface.c
  273. +60 −8 ext/oci8/package.xml
  274. +2 −2 ext/oci8/php_oci8.h
  275. +8 −3 ext/oci8/tests/bind_char_1.phpt
  276. +8 −3 ext/oci8/tests/bind_char_2.phpt
  277. +8 −3 ext/oci8/tests/bind_char_3.phpt
  278. +8 −3 ext/oci8/tests/bind_char_4.phpt
  279. +8 −3 ext/oci8/tests/bug27303_1.phpt
  280. +8 −3 ext/oci8/tests/bug27303_2.phpt
  281. +8 −3 ext/oci8/tests/bug27303_4.phpt
  282. +4 −0 ext/oci8/tests/connect_without_oracle_home.phpt
  283. +41 −0 ext/oci8/tests/connect_without_oracle_home_11.phpt
  284. +4 −0 ext/oci8/tests/connect_without_oracle_home_old.phpt
  285. +41 −0 ext/oci8/tests/connect_without_oracle_home_old_11.phpt
  286. +5 −51 ext/oci8/tests/debug.phpt
  287. +38 −0 ext/oci8/tests/null_byte_1.phpt
  288. +69 −0 ext/oci8/tests/null_byte_2.phpt
  289. +1 −1  ext/oci8/tests/oci8safemode.phpt
  290. +48 −4 ext/odbc/php_odbc.c
  291. +48 −14 ext/openssl/openssl.c
  292. +1 −2  ext/openssl/xp_ssl.c
  293. +135 −3 ext/pcntl/pcntl.c
  294. +6 −1 ext/pcntl/php_pcntl.h
  295. +12 −3 ext/pcntl/php_signal.c
  296. +2 −1  ext/pcntl/php_signal.h
  297. +17 −0 ext/pcntl/tests/pcntl_get_last_error.phpt
  298. +95 −0 ext/pcre/pcrelib/ChangeLog
  299. +11 −0 ext/pcre/pcrelib/NEWS
  300. +4 −4 ext/pcre/pcrelib/NON-UNIX-USE
Sorry, we could not display the entire diff because too many files (653) changed.
View
36 INSTALL
@@ -279,7 +279,15 @@ ir if
it is your first install then you need to "make install" as well)
13. cd ../php-5.x.y
-14. cp php.ini-dist /usr/local/lib/php.ini
+
+14. The PHP distribution provides two sample php.ini files, you can use them
+ by
+ cp php.ini-development /usr/local/lib/php.ini
+ or
+ cp php.ini-production /usr/local/lib/php.ini
+
+ If you choose one of these php.ini files be certain to read the list
+ of changes within, as they affect how PHP behaves.
15. You can edit /usr/local/lib/php.ini file to set PHP options.
Edit your httpd.conf or srm.conf file and add:
@@ -451,15 +459,19 @@ Apache 2.0 on Unix systems
13. Setup your php.ini
- cp php.ini-dist /usr/local/lib/php.ini
+ The PHP distribution provides two sample php.ini files, you can use them
+ by
+ cp php.ini-development /usr/local/lib/php.ini
+ or
+ cp php.ini-production /usr/local/lib/php.ini
+
+ If you choose one of these php.ini files be certain to read the list
+ of changes within, as they affect how PHP behaves.
You may edit your .ini file to set PHP options. If you prefer having
php.ini in another location, use --with-config-file-path=/some/path in
step 10.
- If you instead choose php.ini-recommended, be certain to read the list
- of changes within, as they affect how PHP behaves.
-
14. Edit your httpd.conf to load the PHP module. The path on the right hand
side of the LoadModule statement must point to the path of the PHP
module on your system. The make install from above may have already
@@ -858,7 +870,7 @@ Using Binary Packages
Example 2-6. OpenBSD Package Install Example
# pkg_add php4-core-4.3.8.tgz
# /usr/local/sbin/phpxs -s
-# cp /usr/local/share/doc/php4/php.ini-recommended /var/www/conf/php.ini
+# cp /usr/local/share/doc/php4/php.ini-development /var/www/conf/php.ini
(add in mysql)
# pkg_add php4-mysql-4.3.8.tgz
# /usr/local/sbin/phpxs -a mysql
@@ -1242,10 +1254,10 @@ setenv OPTIM=-O2
back to the root of the Apache source directory and run the above
configure command again. That'll bring the link table up to date.
Run make and make install again.
- 7. Copy and rename the php.ini-dist file to your bin directory from
- your PHP 4 source directory: cp php.ini-dist /usr/local/bin/php.ini
- or (if your don't have a local directory) cp php.ini-dist
- /usr/bin/php.ini.
+ 7. Copy and rename the php.ini-development or php.ini-production file to
+ your bin directory from your PHP 4 source directory:
+ cp php.ini-development /usr/local/bin/php.ini or (if your don't have a
+ local directory) cp php.ini-development /usr/bin/php.ini.
__________________________________________________________________
Compiling for MacOS X Client
@@ -1735,8 +1747,8 @@ cgi error:
example, set it with something like:
--with-config-file-path=/etc
- And then you would copy php.ini-dist from the distribution to
- /etc/php.ini and edit it to make any local changes you want.
+ And then you would copy php.ini-development or php.ini-production from the
+ distribution to /etc/php.ini and edit it to make any local changes you want.
--with-config-file-scan-dir=PATH
On Windows the default path for the php.ini file is the Windows
View
2  LICENSE
@@ -1,6 +1,6 @@
--------------------------------------------------------------------
The PHP License, version 3.01
-Copyright (c) 1999 - 2009 The PHP Group. All rights reserved.
+Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
View
1  Makefile.global
@@ -98,6 +98,7 @@ test: all
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
+ rm $(top_builddir)/tmp-php.ini; \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
View
362 NEWS
@@ -1,5 +1,361 @@
-PHP NEWS
+PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+06 Jan 2011, PHP 5.3.5
+- Fixed Bug #53632 (infinite loop with x87 fpu). (Scott, Rasmus)
+
+09 Dec 2010, PHP 5.3.4
+- Upgraded bundled Sqlite3 to version 3.7.3. (Ilia)
+- Upgraded bundled PCRE to version 8.10. (Ilia)
+
+- Security enhancements:
+ . Fixed crash in zip extract method (possible CWE-170).
+ (Maksymilian Arciemowicz, Pierre)
+ . Paths with NULL in them (foo\0bar.txt) are now considered as invalid. (Rasmus)
+ . Fixed a possible double free in imap extension (Identified by Mateusz
+ Kocielski). (CVE-2010-4150). (Ilia)
+ . Fixed NULL pointer dereference in ZipArchive::getArchiveComment.
+ (CVE-2010-3709). (Maksymilian Arciemowicz)
+ . Fixed possible flaw in open_basedir (CVE-2010-3436). (Pierre)
+ . Fixed MOPS-2010-24, fix string validation. (CVE-2010-2950). (Pierre)
+ . Fixed symbolic resolution support when the target is a DFS share. (Pierre)
+ . Fixed bug #52929 (Segfault in filter_var with FILTER_VALIDATE_EMAIL with
+ large amount of data) (CVE-2010-3710). (Adam)
+
+- General improvements:
+ . Added stat support for zip stream. (Pierre)
+ . Added follow_location (enabled by default) option for the http stream
+ support. (Pierre)
+ . Improved support for is_link and related functions on Windows. (Pierre)
+ . Added a 3rd parameter to get_html_translation_table. It now takes a charset
+ hint, like htmlentities et al. (Gustavo)
+
+- Implemented feature requests:
+ . Implemented FR #52348, added new constant ZEND_MULTIBYTE to detect
+ zend multibyte at runtime. (Kalle)
+ . Implemented FR #52173, added functions pcntl_get_last_error() and
+ pcntl_strerror(). (nick dot telford at gmail dot com, Arnaud)
+ . Implemented symbolic links support for open_basedir checks. (Pierre)
+ . Implemented FR #51804, SplFileInfo::getLinkTarget on Windows. (Pierre)
+ . Implemented FR #50692, not uploaded files don't count towards
+ max_file_uploads limit. As a side improvement, temporary files are not opened
+ for empty uploads and, in debug mode, 0-length uploads. (Gustavo)
+
+- Improved MySQLnd:
+ . Added new character sets to mysqlnd, which are available in MySQL 5.5
+ (Andrey)
+
+- Improved PHP-FPM SAPI:
+ . Added '-p/--prefix' to php-fpm to use a custom prefix and run multiple
+ instances. (fat)
+ . Added custom process title for FPM. (fat)
+ . Added '-t/--test' to php-fpm to check and validate FPM conf file. (fat)
+ . Added statistics about listening socket queue length for FPM.
+ (andrei dot nigmatulin at gmail dot com, fat)
+
+- Core:
+ . Fixed extract() to do not overwrite $GLOBALS and $this when using
+ EXTR_OVERWRITE. (jorto at redhat dot com)
+ . Fixed bug in the Windows implementation of dns_get_record, where the two
+ last parameters wouldn't be filled unless the type were DNS_ANY (Gustavo).
+ . Changed the $context parameter on copy() to actually have an effect. (Kalle)
+ . Fixed htmlentities/htmlspecialchars accepting certain ill-formed UTF-8
+ sequences. (Gustavo)
+ . Fixed bug #53409 (sleep() returns NULL on Windows). (Pierre)
+ . Fixed bug #53319 (strip_tags() may strip '<br />' incorrectly). (Felipe)
+ . Fixed bug #53304 (quot_print_decode does not handle lower-case hex digits).
+ (Ilia, daniel dot mueller at inexio dot net)
+ . Fixed bug #53248 (rawurlencode RFC 3986 EBCDIC support misses tilde char).
+ (Justin Martin)
+ . Fixed bug #53226 (file_exists fails on big filenames). (Adam)
+ . Fixed bug #53198 (changing INI setting "from" with ini_set did not have any
+ effect). (Gustavo)
+ . Fixed bug #53180 (post_max_size=0 not disabling the limit when the content
+ type is application/x-www-form-urlencoded or is not registered with PHP).
+ (gm at tlink dot de, Gustavo)
+ . Fixed bug #53141 (autoload misbehaves if called from closing session).
+ (ladislav at marek dot su)
+ . Fixed bug #53021 (In html_entity_decode, failure to convert numeric entities
+ with ENT_NOQUOTES and ISO-8859-1). Fixed and extended the fix of ENT_NOQUOTES
+ in html_entity_decode that had introduced the bug (rev #185591) to other
+ encodings. Additionaly, html_entity_decode() now doesn't decode &#34; if
+ ENT_NOQUOTES is given. (Gustavo)
+ . Fixed bug #52931 (strripos not overloaded with function overloading enabled).
+ (Felipe)
+ . Fixed bug #52772 (var_dump() doesn't check for the existence of
+ get_class_name before calling it). (Kalle, Gustavo)
+ . Fixed bug #52534 (var_export array with negative key). (Felipe)
+ . Fixed bug #52327 (base64_decode() improper handling of leading padding in
+ strict mode). (Ilia)
+ . Fixed bug #52260 (dns_get_record fails with non-existing domain on Windows).
+ (a_jelly_doughnut at phpbb dot com, Pierre)
+ . Fixed bug #50953 (socket will not connect to IPv4 address when the host has
+ both IPv4 and IPv6 addresses, on Windows). (Gustavo, Pierre)
+ . Fixed bug #50524 (proc_open on Windows does not respect cwd as it does on
+ other platforms). (Pierre)
+ . Fixed bug #49687 (utf8_decode vulnerabilities and deficiencies in the number
+ of reported malformed sequences). (CVE-2010-3870) (Gustavo)
+ . Fixed bug #49407 (get_html_translation_table doesn't handle UTF-8). (Gustavo)
+ . Fixed bug #48831 (php -i has different output to php --ini). (Richard,
+ Pierre)
+ . Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4).
+ (Felipe)
+ . Fixed bug #47168 (printf of floating point variable prints maximum of 40
+ decimal places). (Ilia)
+ . Fixed bug #46587 (mt_rand() does not check that max is greater than min).
+ (Ilia)
+ . Fixed bug #29085 (bad default include_path on Windows). (Pierre)
+ . Fixed bug #25927 (get_html_translation_table calls the ' &#39; instead of
+ &#039;). (Gustavo)
+
+- Zend engine:
+ . Reverted fix for bug #51176 (Static calling in non-static method behaves
+ like $this->). (Felipe)
+ . Changed deprecated ini options on startup from E_WARNING to E_DEPRECATED.
+ (Kalle)
+ . Fixed NULL dereference in lex_scan on zend multibyte builds where the script
+ had a flex incompatible encoding and there was no converter. (Gustavo)
+ . Fixed covariance of return-by-ref constraints. (Etienne)
+ . Fixed bug #53305 (E_NOTICE when defining a constant starts with
+ __COMPILER_HALT_OFFSET__). (Felipe)
+ . Fixed bug #52939 (zend_call_function does not respect ZEND_SEND_PREFER_REF).
+ (Dmitry)
+ . Fixed bug #52879 (Objects unreferenced in __get, __set, __isset or __unset
+ can be freed too early). (mail_ben_schmidt at yahoo dot com dot au, Dmitry)
+ . Fixed bug #52786 (PHP should reset section to [PHP] after ini sections).
+ (Fedora at famillecollet dot com)
+ . Fixed bug #52508 (newline problem with parse_ini_file+INI_SCANNER_RAW).
+ (Felipe)
+ . Fixed bug #52484 (__set() ignores setting properties with empty names).
+ (Felipe)
+ . Fixed bug #52361 (Throwing an exception in a destructor causes invalid
+ catching). (Dmitry)
+ . Fixed bug #51008 (Zend/tests/bug45877.phpt fails). (Dmitry)
+
+- Build issues:
+ . Fixed bug #52436 (Compile error if systems do not have stdint.h)
+ (Sriram Natarajan)
+ . Fixed bug #50345 (nanosleep not detected properly on some solaris versions).
+ (Ulf, Tony)
+ . Fixed bug #49215 (make fails on glob_wrapper). (Felipe)
+
+- Calendar extension:
+ . Fixed bug #52744 (cal_days_in_month incorrect for December 1 BCE).
+ (gpap at internet dot gr, Adam)
+
+- cURL extension:
+ . Fixed bug #52828 (curl_setopt does not accept persistent streams).
+ (Gustavo, Ilia)
+ . Fixed bug #52827 (cURL leaks handle and causes assertion error
+ (CURLOPT_STDERR)). (Gustavo)
+ . Fixed bug #52202 (CURLOPT_PRIVATE gets corrupted). (Ilia)
+ . Fixed bug #50410 (curl extension slows down PHP on Windows). (Pierre)
+
+- DateTime extension:
+ . Fixed bug #53297 (gettimeofday implementation in php/win32/time.c can return
+ 1 million microsecs). (ped at 7gods dot org)
+ . Fixed bug #52668 (Iterating over a dateperiod twice is broken). (Derick)
+ . Fixed bug #52454 (Relative dates and getTimestamp increments by one day).
+ (Derick)
+ . Fixed bug #52430 (date_parse parse 24:xx:xx as valid time). (Derick)
+ . Added support for the ( and ) delimiters/separators to
+ DateTime::createFromFormat(). (Derick)
+
+- DBA extension:
+ . Added Berkeley DB 5.1 support to the DBA extension. (Oracle Corp.)
+
+- DOM extension:
+ . Fixed bug #52656 (DOMCdataSection does not work with splitText). (Ilia)
+
+- Filter extension:
+ . Fixed the filter extension accepting IPv4 octets with a leading 0 as that
+ belongs to the unsupported "dotted octal" representation. (Gustavo)
+ . Fixed bug #53236 (problems in the validation of IPv6 addresses with leading
+ and trailing :: in the filter extension). (Gustavo)
+ . Fixed bug #50117 (problems in the validation of IPv6 addresses with IPv4
+ addresses and ::). (Gustavo)
+
+- GD extension:
+ . Fixed bug #53492 (fix crash if anti-aliasing steps are invalid). (Pierre)
+
+- GMP extension:
+ . Fixed bug #52906 (gmp_mod returns negative result when non-negative is
+ expected). (Stas)
+ . Fixed bug #52849 (GNU MP invalid version match). (Adam)
+
+- Hash extension:
+ . Fixed bug #51003 (unaligned memory access in ext/hash/hash_tiger.c).
+ (Mike, Ilia)
+
+- Iconv extension:
+ . Fixed bug #52941 (The 'iconv_mime_decode_headers' function is skipping
+ headers). (Adam)
+ . Fixed bug #52599 (iconv output handler outputs incorrect content type
+ when flags are used). (Ilia)
+ . Fixed bug #51250 (iconv_mime_decode() does not ignore malformed Q-encoded
+ words). (Ilia)
+
+- Intl extension:
+ . Fixed crashes on invalid parameters in intl extension. (CVE-2010-4409). (Stas, Maksymilian
+ Arciemowicz)
+ . Added support for formatting the timestamp stored in a DateTime object.
+ (Stas)
+ . Fixed bug #50590 (IntlDateFormatter::parse result is limited to the integer
+ range). (Stas)
+
+- Mbstring extension:
+ . Fixed bug #53273 (mb_strcut() returns garbage with the excessive length
+ parameter). (CVE-2010-4156) (Mateusz Kocielski, Pierre, Moriyoshi)
+ . Fixed bug #52981 (Unicode casing table was out-of-date. Updated with
+ UnicodeData-6.0.0d7.txt and included the source of the generator program with
+ the distribution) (Gustavo).
+ . Fixed bug #52681 (mb_send_mail() appends an extra MIME-Version header).
+ (Adam)
+
+- MSSQL extension:
+ . Fixed possible crash in mssql_fetch_batch(). (Kalle)
+ . Fixed bug #52843 (Segfault when optional parameters are not passed in to
+ mssql_connect). (Felipe)
+
+- MySQL extension:
+ . Fixed bug #52636 (php_mysql_fetch_hash writes long value into int).
+ (Kalle, rein at basefarm dot no)
+
+- MySQLi extension:
+ . Fixed bug #52891 (Wrong data inserted with mysqli/mysqlnd when using
+ mysqli_stmt_bind_param and value> PHP_INT_MAX). (Andrey)
+ . Fixed bug #52686 (mysql_stmt_attr_[gs]et argument points to incorrect type).
+ (rein at basefarm dot no)
+ . Fixed bug #52654 (mysqli doesn't install headers with structures it uses).
+ (Andrey)
+ . Fixed bug #52433 (Call to undefined method mysqli::poll() - must be static).
+ (Andrey)
+ . Fixed bug #52417 (MySQLi build failure with mysqlnd on MacOS X). (Andrey)
+ . Fixed bug #52413 (MySQLi/libmysql build failure on OS X, FreeBSD). (Andrey)
+ . Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle)
+ . Fixed bug #52302 (mysqli_fetch_all does not work with MYSQLI_USE_RESULT).
+ (Andrey)
+ . Fixed bug #52221 (Misbehaviour of magic_quotes_runtime (get/set)). (Andrey)
+ . Fixed bug #45921 (Can't initialize character set hebrew). (Andrey)
+
+- MySQLnd:
+ . Fixed bug #52613 (crash in mysqlnd after hitting memory limit). (Andrey)
+
+- ODBC extension:
+ - Fixed bug #52512 (Broken error handling in odbc_execute).
+ (mkoegler at auto dot tuwien dot ac dot at)
+
+- Openssl extension:
+ . Fixed possible blocking behavior in openssl_random_pseudo_bytes on Windows.
+ (Pierre)
+ . Fixed bug #53136 (Invalid read on openssl_csr_new()). (Felipe)
+ . Fixed bug #52947 (segfault when ssl stream option capture_peer_cert_chain
+ used). (Felipe)
+
+- Oracle Database extension (OCI8):
+ . Fixed bug #53284 (Valgrind warnings in oci_set_* functions) (Oracle Corp.)
+ . Fixed bug #51610 (Using oci_connect causes PHP to take a long time to
+ exit). Requires Oracle 11.2.0.2 client libraries (or Oracle bug fix
+ 9891199) for this patch to have an effect. (Oracle Corp.)
+
+- PCNTL extension:
+ . Fixed bug #52784 (Race condition when handling many concurrent signals).
+ (nick dot telford at gmail dot com, Arnaud)
+
+- PCRE extension:
+ . Fixed bug #52971 (PCRE-Meta-Characters not working with utf-8). (Felipe)
+ . Fixed bug #52732 (Docs say preg_match() returns FALSE on error, but it
+ returns int(0)). (slugonamission at gmail dot com)
+
+- PHAR extension:
+ . Fixed bug #50987 (unaligned memory access in phar.c).
+ (geissert at debian dot org, Ilia)
+
+- PHP-FPM SAPI:
+ . Fixed bug #53412 (segfault when using -y). (fat)
+ . Fixed inconsistent backlog default value (-1) in FPM on many systems. (fat)
+ . Fixed bug #52501 (libevent made FPM crashed when forking -- libevent has
+ been removed). (fat)
+ . Fixed bug #52725 (gcc builtin atomic functions were sometimes used when they
+ were not available). (fat)
+ . Fixed bug #52693 (configuration file errors are not logged to stderr). (fat)
+ . Fixed bug #52674 (FPM Status page returns inconsistent Content-Type headers).
+ (fat)
+ . Fixed bug #52498 (libevent was not only linked to php-fpm). (fat)
+
+- PDO:
+ . Fixed bug #52699 (PDO bindValue writes long int 32bit enum).
+ (rein at basefarm dot no)
+ . Fixed bug #52487 (PDO::FETCH_INTO leaks memory). (Felipe)
+
+- PDO DBLib driver:
+ . Fixed bug #52546 (pdo_dblib segmentation fault when iterating MONEY values).
+ (Felipe)
+
+- PDO Firebird driver:
+ . Restored firebird support (VC9 builds only). (Pierre)
+ . Fixed bug #53335 (pdo_firebird did not implement rowCount()).
+ (preeves at ibphoenix dot com)
+ . Fixed bug #53323 (pdo_firebird getAttribute() crash).
+ (preeves at ibphoenix dot com)
+
+- PDO MySQL driver:
+ . Fixed bug #52745 (Binding params doesn't work when selecting a date inside a
+ CASE-WHEN). (Andrey)
+
+- PostgreSQL extension:
+ . Fixed bug #47199 (pg_delete() fails on NULL). (ewgraf at gmail dot com)
+
+- Reflection extension:
+ . Fixed ReflectionProperty::isDefault() giving a wrong result for properties
+ obtained with ReflectionClass::getProperties(). (Gustavo)
+- Reflection extension:
+ . Fixed bug #53366 (Reflection doesnt get dynamic property value from
+ getProperty()). (Felipe)
+ . Fixed bug #52854 (ReflectionClass::newInstanceArgs does not work for classes
+ without constructors). (Johannes)
+
+- SOAP extension:
+ . Fixed bug #44248 (RFC2616 transgression while HTTPS request through proxy
+ with SoapClient object). (Dmitry)
+
+- SPL extension:
+ . Fixed bug #53362 (Segmentation fault when extending SplFixedArray). (Felipe)
+ . Fixed bug #53279 (SplFileObject doesn't initialise default CSV escape
+ character). (Adam)
+ . Fixed bug #53144 (Segfault in SplObjectStorage::removeAll()). (Felipe)
+ . Fixed bug #53071 (SPLObjectStorage defeats gc_collect_cycles). (Gustavo)
+ . Fixed bug #52573 (SplFileObject::fscanf Segmentation fault). (Felipe)
+ . Fixed bug #51763 (SplFileInfo::getType() does not work symbolic link
+ and directory). (Pierre)
+ . Fixed bug #50481 (Storing many SPLFixedArray in an array crashes). (Felipe)
+ . Fixed bug #50579 (RegexIterator::REPLACE doesn't work). (Felipe)
+
+- SQLite3 extension:
+ . Fixed bug #53463 (sqlite3 columnName() segfaults on bad column_number).
+ (Felipe)
+
+- Streams:
+ . Fixed forward stream seeking emulation in streams that don't support seeking
+ in situations where the read operation gives back less data than requested
+ and when there was data in the buffer before the emulation started. Also made
+ more consistent its behavior -- should return failure every time less data
+ than was requested was skipped. (Gustavo)
+ . Fixed bug #53241 (stream casting that relies on fdopen/fopencookie fails
+ with streams opened with, inter alia, the 'xb' mode). (Gustavo)
+ . Fixed bug #53006 (stream_get_contents has an unpredictable behavior when the
+ underlying stream does not support seeking). (Gustavo)
+ . Fixed bug #52944 (Invalid write on second and subsequent reads with an
+ inflate filter fed invalid data). (Gustavo)
+ . Fixed bug #52820 (writes to fopencookie FILE* not commited when seeking the
+ stream). (Gustavo)
+
+- WDDX extension:
+ . Fixed bug #52468 (wddx_deserialize corrupts integer field value when left
+ empty). (Felipe)
+
+- Zlib extension:
+ . Fixed bug #52926 (zlib fopen wrapper does not use context). (Gustavo)
+
22 Jul 2010, PHP 5.3.3
- Upgraded bundled sqlite to version 3.6.23.1. (Ilia)
- Upgraded bundled PCRE to version 8.02. (Ilia)
@@ -234,8 +590,6 @@ PHP NEWS
com, Pierre)
- Fixed bug #50578 (incorrect shebang in phar.phar). (Fedora at FamilleCollet
dot com)
-- Fixed bug #50555 (DateTime::sub() allows 'relative' time modifications).
- (Derick)
- Fixed bug #50392 (date_create_from_format enforces 6 digits for 'u' format
character). (Derick)
- Fixed bug #50383 (Exceptions thrown in __call / __callStatic do not include
@@ -243,6 +597,8 @@ PHP NEWS
- Fixed bug #50358 (Compile failure compiling ext/phar/util.lo). (Felipe)
- Fixed bug #50101 (name clash between global and local variable).
(patch by yoarvi at gmail dot com)
+- Fixed bug #50055 (DateTime::sub() allows 'relative' time modifications).
+ (Derick)
- Fixed bug #51002 (fix possible memory corruption with very long names).
(Pierre)
- Fixed bug #49893 (Crash while creating an instance of Zend_Mail_Storage_Pop3).
View
301 TSRM/tsrm_virtual_cwd.c
@@ -14,10 +14,11 @@
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Sascha Schumann <sascha@schumann.cx> |
+ | Pierre Joye <pierre@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.c 300276 2010-06-08 13:27:30Z tony2001 $ */
+/* $Id: tsrm_virtual_cwd.c 305070 2010-11-04 01:16:20Z pajoye $ */
#include <sys/types.h>
#include <sys/stat.h>
@@ -38,6 +39,18 @@
# ifndef IO_REPARSE_TAG_SYMLINK
# define IO_REPARSE_TAG_SYMLINK 0xA000000C
# endif
+
+# ifndef VOLUME_NAME_NT
+# define VOLUME_NAME_NT 0x2
+# endif
+
+# ifndef VOLUME_NAME_DOS
+# define VOLUME_NAME_DOS 0x0
+# endif
+#endif
+
+#ifndef S_IFLNK
+# define S_IFLNK 0120000
#endif
#ifdef NETWARE
@@ -83,14 +96,14 @@ cwd_state main_cwd_state; /* True global */
#include <tchar.h>
#define tsrm_strtok_r(a,b,c) _tcstok((a),(b))
#define TOKENIZER_STRING "/\\"
-
-static int php_check_dots(const char *element, int n)
+
+static int php_check_dots(const char *element, int n)
{
while (n-- > 0) if (element[n] != '.') break;
return (n != -1);
}
-
+
#define IS_DIRECTORY_UP(element, len) \
(len >= 2 && !php_check_dots(element, len))
@@ -124,7 +137,7 @@ static int php_check_dots(const char *element, int n)
/* define this to check semantics */
#define IS_DIR_OK(s) (1)
-
+
#ifndef IS_DIR_OK
#define IS_DIR_OK(state) (php_is_dir_ok(state) == 0)
#endif
@@ -137,7 +150,7 @@ static int php_check_dots(const char *element, int n)
#define CWD_STATE_FREE(s) \
free((s)->cwd);
-
+
#ifdef TSRM_WIN32
#ifdef CTL_CODE
@@ -202,21 +215,98 @@ static inline time_t FileTimeToUnixTime(const FILETIME FileTime)
return (time_t)UnixTime;
}
+CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){ /* {{{ */
+ HINSTANCE kernel32;
+ HANDLE hFile;
+ DWORD dwRet;
+
+ typedef BOOL (WINAPI *gfpnh_func)(HANDLE, LPTSTR, DWORD, DWORD);
+ gfpnh_func pGetFinalPathNameByHandle;
+
+ kernel32 = LoadLibrary("kernel32.dll");
+
+ if (kernel32) {
+ pGetFinalPathNameByHandle = (gfpnh_func)GetProcAddress(kernel32, "GetFinalPathNameByHandleA");
+ if (pGetFinalPathNameByHandle == NULL) {
+ return -1;
+ }
+ } else {
+ return -1;
+ }
+
+ hFile = CreateFile(link, // file to open
+ GENERIC_READ, // open for reading
+ FILE_SHARE_READ, // share for reading
+ NULL, // default security
+ OPEN_EXISTING, // existing file only
+ FILE_FLAG_BACKUP_SEMANTICS, // normal file
+ NULL); // no attr. template
+
+ if( hFile == INVALID_HANDLE_VALUE) {
+ return -1;
+ }
+
+ dwRet = pGetFinalPathNameByHandle(hFile, target, MAXPATHLEN, VOLUME_NAME_DOS);
+ if(dwRet >= MAXPATHLEN) {
+ return -1;
+ }
+
+ CloseHandle(hFile);
+
+ if(dwRet > 4) {
+ /* Skip first 4 characters if they are "\??\" */
+ if(target[0] == '\\' && target[1] == '\\' && target[2] == '?' && target[3] == '\\') {
+ char tmp[MAXPATHLEN];
+ unsigned int offset = 4;
+ dwRet -= 4;
+
+ /* \??\UNC\ */
+ if (dwRet > 7 && target[4] == 'U' && target[5] == 'N' && target[6] == 'C') {
+ offset += 2;
+ dwRet -= 2;
+ target[offset] = '\\';
+ }
+
+ memcpy(tmp, target + offset, dwRet);
+ memcpy(target, tmp, dwRet);
+ }
+ }
+
+ target[dwRet] = '\0';
+ return dwRet;
+}
+/* }}} */
+
CWD_API int php_sys_stat(const char *path, struct stat *buf) /* {{{ */
{
+ return php_sys_stat_ex(path, buf, 0);
+}
+/* }}} */
+
+CWD_API int php_sys_lstat(const char *path, struct stat *buf) /* {{{ */
+{
+ return php_sys_stat_ex(path, buf, 1);
+}
+/* }}} */
+
+CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat) /* {{{ */
+{
WIN32_FILE_ATTRIBUTE_DATA data;
__int64 t;
+ const size_t path_len = strlen(path);
if (!GetFileAttributesEx(path, GetFileExInfoStandard, &data)) {
return stat(path, buf);
}
- if (path[1] == ':') {
+ if (path_len >= 1 && path[1] == ':') {
if (path[0] >= 'A' && path[0] <= 'Z') {
buf->st_dev = buf->st_rdev = path[0] - 'A';
} else {
buf->st_dev = buf->st_rdev = path[0] - 'a';
}
+ } else if (IS_UNC_PATH(path, path_len)) {
+ buf->st_dev = buf->st_rdev = 0;
} else {
char cur_path[MAXPATHLEN+1];
DWORD len = sizeof(cur_path);
@@ -245,19 +335,56 @@ CWD_API int php_sys_stat(const char *path, struct stat *buf) /* {{{ */
}
if (tmp != cur_path) {
free(tmp);
- }
+ }
}
+
buf->st_uid = buf->st_gid = buf->st_ino = 0;
- buf->st_mode = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? (S_IFDIR|S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)) : S_IFREG;
- buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6));
+
+ if (lstat && data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ /* File is a reparse point. Get the target */
+ HANDLE hLink = NULL;
+ REPARSE_DATA_BUFFER * pbuffer;
+ unsigned int retlength = 0;
+ TSRM_ALLOCA_FLAG(use_heap_large);
+
+ hLink = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if(hLink == INVALID_HANDLE_VALUE) {
+ return -1;
+ }
+
+ pbuffer = (REPARSE_DATA_BUFFER *)tsrm_do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
+ if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) {
+ tsrm_free_alloca(pbuffer, use_heap_large);
+ CloseHandle(hLink);
+ return -1;
+ }
+
+ CloseHandle(hLink);
+
+ if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
+ buf->st_mode = S_IFLNK;
+ buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6));
+ }
+
+#if 0 /* Not used yet */
+ else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
+ buf->st_mode |=;
+ }
+#endif
+ tsrm_free_alloca(pbuffer, use_heap_large);
+ } else {
+ buf->st_mode = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? (S_IFDIR|S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)) : S_IFREG;
+ buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6));
+ }
+
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
int len = strlen(path);
if (path[len-4] == '.') {
if (_memicmp(path+len-3, "exe", 3) == 0 ||
- _memicmp(path+len-3, "com", 3) == 0 ||
- _memicmp(path+len-3, "bat", 3) == 0 ||
- _memicmp(path+len-3, "cmd", 3) == 0) {
+ _memicmp(path+len-3, "com", 3) == 0 ||
+ _memicmp(path+len-3, "bat", 3) == 0 ||
+ _memicmp(path+len-3, "cmd", 3) == 0) {
buf->st_mode |= (S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6));
}
}
@@ -332,7 +459,7 @@ CWD_API void virtual_cwd_startup(void) /* {{{ */
}
}
#else
- result = getcwd(cwd, sizeof(cwd));
+ result = getcwd(cwd, sizeof(cwd));
#endif
if (!result) {
cwd[0] = '\0';
@@ -383,7 +510,7 @@ CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */
*length = 1;
retval = (char *) malloc(2);
retval[0] = DEFAULT_SLASH;
- retval[1] = '\0';
+ retval[1] = '\0';
return retval;
}
@@ -493,7 +620,7 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{
while (*bucket != NULL) {
if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
- memcmp(path, (*bucket)->path, path_len) == 0) {
+ memcmp(path, (*bucket)->path, path_len) == 0) {
realpath_cache_bucket *r = *bucket;
*bucket = (*bucket)->next;
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
@@ -510,9 +637,9 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
{
long size = sizeof(realpath_cache_bucket) + path_len + 1;
int same = 1;
-
+
if (realpath_len != path_len ||
- memcmp(path, realpath, path_len) != 0) {
+ memcmp(path, realpath, path_len) != 0) {
size += realpath_len + 1;
same = 0;
}
@@ -570,7 +697,7 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
free(r);
} else if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
- memcmp(path, (*bucket)->path, path_len) == 0) {
+ memcmp(path, (*bucket)->path, path_len) == 0) {
return *bucket;
} else {
bucket = &(*bucket)->next;
@@ -582,21 +709,21 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
{
- return realpath_cache_find(path, path_len, t TSRMLS_CC);
+ return realpath_cache_find(path, path_len, t TSRMLS_CC);
}
/* }}} */
-CWD_API int realpath_cache_size(TSRMLS_D)
+CWD_API int realpath_cache_size(TSRMLS_D)
{
return CWDG(realpath_cache_size);
}
-CWD_API int realpath_cache_max_buckets(TSRMLS_D)
+CWD_API int realpath_cache_max_buckets(TSRMLS_D)
{
return (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
}
-CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D)
+CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D)
{
return CWDG(realpath_cache);
}
@@ -650,14 +777,14 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (!start) {
/* leading '..' must not be removed in case of relative path */
if (j == 0 && path[0] == '.' && path[1] == '.' &&
- IS_SLASH(path[2])) {
+ IS_SLASH(path[2])) {
path[3] = '.';
path[4] = '.';
path[5] = DEFAULT_SLASH;
j = 5;
- } else if (j > 0 &&
- path[j+1] == '.' && path[j+2] == '.' &&
- IS_SLASH(path[j+3])) {
+ } else if (j > 0 &&
+ path[j+1] == '.' && path[j+2] == '.' &&
+ IS_SLASH(path[j+3])) {
j += 4;
path[j++] = '.';
path[j++] = '.';
@@ -673,7 +800,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
}
return j;
}
-
+
path[len] = 0;
save = (use_realpath != CWD_EXPAND);
@@ -683,18 +810,18 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (!*t) {
*t = time(0);
}
- if ((bucket = realpath_cache_find(path, len, *t TSRMLS_CC)) != NULL) {
- if (is_dir && !bucket->is_dir) {
+ if ((bucket = realpath_cache_find(path, len, *t TSRMLS_CC)) != NULL) {
+ if (is_dir && !bucket->is_dir) {
/* not a directory */
return -1;
- } else {
- if (link_is_dir) {
- *link_is_dir = bucket->is_dir;
- }
+ } else {
+ if (link_is_dir) {
+ *link_is_dir = bucket->is_dir;
+ }
memcpy(path, bucket->realpath, bucket->realpath_len + 1);
- return bucket->realpath_len;
+ return bucket->realpath_len;
}
- }
+ }
}
#ifdef TSRM_WIN32
@@ -706,7 +833,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
/* continue resolution anyway but don't save result in the cache */
save = 0;
}
-
+
if (save) {
FindClose(hFind);
}
@@ -714,9 +841,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
tmp = tsrm_do_alloca(len+1, use_heap);
memcpy(tmp, path, len+1);
- if(save &&
- !(IS_UNC_PATH(path, len) && len >= 3 && path[2] != '?') &&
- (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
+ if(save &&
+ !(IS_UNC_PATH(path, len) && len >= 3 && path[2] != '?') &&
+ (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
/* File is a reparse point. Get the target */
HANDLE hLink = NULL;
REPARSE_DATA_BUFFER * pbuffer;
@@ -751,7 +878,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
- if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
+ if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
printname_len + 1,
printname, MAX_PATH, NULL, NULL
@@ -763,7 +890,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
printname[printname_len] = 0;
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
- if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
+ if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
substitutename_len + 1,
substitutename, MAX_PATH, NULL, NULL
@@ -777,7 +904,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
isabsolute = 1;
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
- if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
+ if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
printname_len + 1,
printname, MAX_PATH, NULL, NULL
@@ -788,7 +915,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0;
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
- if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
+ if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
substitutename_len + 1,
substitutename, MAX_PATH, NULL, NULL
@@ -803,20 +930,22 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
}
if(isabsolute && substitutename_len > 4) {
- /* Do not resolve volumes (for now). A mounted point can
+ /* Do not resolve volumes (for now). A mounted point can
target a volume without a drive, it is not certain that
- all IO functions we use in php and its deps support
+ all IO functions we use in php and its deps support
path with volume GUID instead of the DOS way, like:
d:\test\mnt\foo
\\?\Volume{62d1c3f8-83b9-11de-b108-806e6f6e6963}\foo
*/
- if (strncmp(substitutename, "\\??\\Volume{",11) == 0
- || strncmp(substitutename, "\\\\?\\Volume{",11) == 0) {
- isVolume = TRUE;
+ if (strncmp(substitutename, "\\??\\Volume{",11) == 0
+ || strncmp(substitutename, "\\\\?\\Volume{",11) == 0
+ || strncmp(substitutename, "\\??\\UNC\\", 8) == 0
+ ) {
+ isVolume = TRUE;
substitutename_off = 0;
} else
/* do not use the \??\ and \\?\ prefix*/
- if (strncmp(substitutename, "\\??\\", 4) == 0
+ if (strncmp(substitutename, "\\??\\", 4) == 0
|| strncmp(substitutename, "\\\\?\\", 4) == 0) {
substitutename_off = 4;
}
@@ -887,7 +1016,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
tmp = tsrm_do_alloca(len+1, use_heap);
memcpy(tmp, path, len+1);
#else
- if (save && lstat(path, &st) < 0) {
+ if (save && php_sys_lstat(path, &st) < 0) {
if (use_realpath == CWD_REALPATH) {
/* file not found */
return -1;
@@ -900,8 +1029,8 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
memcpy(tmp, path, len+1);
if (save && S_ISLNK(st.st_mode)) {
- if (++(*ll) > LINK_MAX || (j = readlink(tmp, path, MAXPATHLEN)) < 0) {
- /* too many links or broken symlinks */
+ if (++(*ll) > LINK_MAX || (j = php_sys_readlink(tmp, path, MAXPATHLEN)) < 0) {
+ /* too many links or broken symlinks */
tsrm_free_alloca(tmp, use_heap);
return -1;
}
@@ -913,10 +1042,10 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
return -1;
}
} else {
- if (i + j >= MAXPATHLEN-1) {
+ if (i + j >= MAXPATHLEN-1) {
tsrm_free_alloca(tmp, use_heap);
return -1; /* buffer overflow */
- }
+ }
memmove(path+i, path, j+1);
memcpy(path, tmp, i-1);
path[i-1] = DEFAULT_SLASH;
@@ -1038,18 +1167,18 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
state_cwd_length = 2;
while (IS_SLASH(state->cwd[state_cwd_length])) {
state_cwd_length++;
- }
+ }
while (state->cwd[state_cwd_length] &&
- !IS_SLASH(state->cwd[state_cwd_length])) {
+ !IS_SLASH(state->cwd[state_cwd_length])) {
state_cwd_length++;
- }
+ }
while (IS_SLASH(state->cwd[state_cwd_length])) {
state_cwd_length++;
- }
+ }
while (state->cwd[state_cwd_length] &&
- !IS_SLASH(state->cwd[state_cwd_length])) {
+ !IS_SLASH(state->cwd[state_cwd_length])) {
state_cwd_length++;
- }
+ }
}
}
#endif
@@ -1061,7 +1190,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
memcpy(resolved_path + state_cwd_length + 1, path, path_length + 1);
path_length += state_cwd_length + 1;
}
- } else {
+ } else {
#ifdef TSRM_WIN32
if (path_length > 2 && path[1] == ':' && !IS_SLASH(path[2])) {
resolved_path[0] = path[0];
@@ -1072,11 +1201,11 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
} else
#endif
memcpy(resolved_path, path, path_length + 1);
- }
+ }
#ifdef TSRM_WIN32
if (memchr(resolved_path, '*', path_length) ||
- memchr(resolved_path, '?', path_length)) {
+ memchr(resolved_path, '?', path_length)) {
return 1;
}
#endif
@@ -1126,12 +1255,12 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
add_slash = (use_realpath != CWD_REALPATH) && path_length > 0 && IS_SLASH(resolved_path[path_length-1]);
t = CWDG(realpath_cache_ttl) ? 0 : -1;
path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, 0, NULL TSRMLS_CC);
-
+
if (path_length < 0) {
errno = ENOENT;
return 1;
}
-
+
if (!start && !path_length) {
resolved_path[path_length++] = '.';
}
@@ -1184,7 +1313,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
memcpy(state->cwd, resolved_path, state->cwd_length+1);
ret = 0;
}
-
+
#if VIRTUAL_CWD_DEBUG
fprintf (stderr, "virtual_file_ex() = %s\n",state->cwd);
#endif
@@ -1207,7 +1336,7 @@ CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path
if (length == 0) {
return 1; /* Can't cd to empty string */
- }
+ }
while(--length >= 0 && !IS_SLASH(path[length])) {
}
@@ -1242,16 +1371,16 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {
if (!*path) {
new_state.cwd = (char*)malloc(1);
new_state.cwd[0] = '\0';
- new_state.cwd_length = 0;
- if (VCWD_GETCWD(cwd, MAXPATHLEN)) {
- path = cwd;
+ new_state.cwd_length = 0;
+ if (VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ path = cwd;
}
} else if (!IS_ABSOLUTE_PATH(path, strlen(path))) {
CWD_STATE_COPY(&new_state, &CWDG(cwd));
} else {
new_state.cwd = (char*)malloc(1);
new_state.cwd[0] = '\0';
- new_state.cwd_length = 0;
+ new_state.cwd_length = 0;
}
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) {
@@ -1317,7 +1446,7 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
{
cwd_state new_state;
int ret;
-
+
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
CWD_STATE_FREE(&new_state);
@@ -1329,9 +1458,9 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */
#else
ret = access(new_state.cwd, mode);
#endif
-
+
CWD_STATE_FREE(&new_state);
-
+
return ret;
}
/* }}} */
@@ -1352,12 +1481,12 @@ static void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
{
FILETIME mtime, atime;
- HANDLE hFile;
+ HANDLE hFile;
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
- /* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
+ /* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
the CreateFile operation succeeds */
if (GetLastError() == ERROR_ALREADY_EXISTS) {
SetLastError(0);
@@ -1477,7 +1606,7 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */
f = open(new_state.cwd, flags, mode);
} else {
f = open(new_state.cwd, flags);
- }
+ }
CWD_STATE_FREE(&new_state);
return f;
}
@@ -1556,7 +1685,6 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
}
/* }}} */
-#if !defined(TSRM_WIN32)
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */
{
cwd_state new_state;
@@ -1568,13 +1696,12 @@ CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ *
return -1;
}
- retval = lstat(new_state.cwd, buf);
+ retval = php_sys_lstat(new_state.cwd, buf);
CWD_STATE_FREE(&new_state);
return retval;
}
/* }}} */
-#endif
CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */
{
@@ -1738,7 +1865,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /*
}
*ptr++ = '\'';
}
-
+
*ptr++ = ' ';
*ptr++ = ';';
*ptr++ = ' ';
@@ -1761,18 +1888,18 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{
if (!*path) {
new_state.cwd = (char*)malloc(1);
new_state.cwd[0] = '\0';
- new_state.cwd_length = 0;
- if (VCWD_GETCWD(cwd, MAXPATHLEN)) {
- path = cwd;
+ new_state.cwd_length = 0;
+ if (VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ path = cwd;
}
} else if (!IS_ABSOLUTE_PATH(path, strlen(path)) &&
- VCWD_GETCWD(cwd, MAXPATHLEN)) {
+ VCWD_GETCWD(cwd, MAXPATHLEN)) {
new_state.cwd = strdup(cwd);
new_state.cwd_length = strlen(cwd);
} else {
new_state.cwd = (char*)malloc(1);
new_state.cwd[0] = '\0';
- new_state.cwd_length = 0;
+ new_state.cwd_length = 0;
}
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
View
24 TSRM/tsrm_virtual_cwd.h
@@ -14,10 +14,11 @@
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Sascha Schumann <sascha@schumann.cx> |
+ | Pierre Joye <pierre@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.h 293036 2010-01-03 09:23:27Z sebastian $ */
+/* $Id: tsrm_virtual_cwd.h 305070 2010-11-04 01:16:20Z pajoye $ */
#ifndef VIRTUAL_CWD_H
#define VIRTUAL_CWD_H
@@ -107,7 +108,7 @@ typedef unsigned short mode_t;
#define COPY_WHEN_ABSOLUTE(path) 0
#endif
-#ifndef IS_ABSOLUTE_PATH
+#ifndef IS_ABSOLUTE_PATH
#define IS_ABSOLUTE_PATH(path, len) \
(IS_SLASH(path[0]))
#endif
@@ -129,9 +130,16 @@ typedef unsigned short mode_t;
#endif
#ifdef TSRM_WIN32
+CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat);
CWD_API int php_sys_stat(const char *path, struct stat *buf);
+CWD_API int php_sys_lstat(const char *path, struct stat *buf);
+CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len);
#else
# define php_sys_stat stat
+# define php_sys_lstat lstat
+# ifdef HAVE_SYMLINK
+# define php_sys_readlink(link, target, target_len) readlink(link, target, target_len)
+# endif
#endif
typedef struct _cwd_state {
@@ -155,9 +163,7 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC);
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
-#if !defined(TSRM_WIN32)
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
-#endif
CWD_API int virtual_unlink(const char *path TSRMLS_DC);
CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC);
CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC);
@@ -188,7 +194,7 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC);
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC);
#endif
-/* One of the following constants must be used as the last argument
+/* One of the following constants must be used as the last argument
in virtual_file_ex() call. */
#define CWD_EXPAND 0 /* expand "." and ".." but dont resolve symlinks */
@@ -216,7 +222,7 @@ typedef struct _realpath_cache_bucket {
unsigned char is_wvalid;
unsigned char is_writable;
#endif
- struct _realpath_cache_bucket *next;
+ struct _realpath_cache_bucket *next;
} realpath_cache_bucket;
typedef struct _virtual_cwd_globals {
@@ -244,7 +250,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
/* The actual macros to be used in programs using TSRM
* If the program defines VIRTUAL_DIR it will use the
- * virtual_* functions
+ * virtual_* functions
*/
#ifdef VIRTUAL_DIR
@@ -261,9 +267,7 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D);
#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC)
#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC)
#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC)
-#if !defined(TSRM_WIN32)
-# define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC)
-#endif
+#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC)
#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC)
#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode TSRMLS_CC)
#define VCWD_RMDIR(pathname) virtual_rmdir(pathname TSRMLS_CC)
View
15 UPGRADING
@@ -1,4 +1,4 @@
-$Id: UPGRADING 282950 2009-06-28 16:14:30Z johannes $
+$Id: UPGRADING 306076 2010-12-08 09:38:47Z pajoye $
UPGRADE NOTES - PHP 5.3
@@ -40,6 +40,9 @@ UPGRADE NOTES - PHP 5.3
2. Changes made to existing functions
=====================================
+- Paths containing NULL (like /some/path\0foo.txt) are now considered invalid.
+ See http://news.php.net/php.internals/50191
+
- The HTTP stream wrapper now considers all status codes from 200 to 399 to be
successful.
@@ -273,6 +276,8 @@ UPGRADE NOTES - PHP 5.3
- MySQLi: Now supports persistent connections by prepending the hostname
with "p:".
+ - imagepstext now rejects invalid antialiasing steps and raises a warning.
+
d. no longer possible to disable
- PCRE
@@ -457,6 +462,14 @@ UPGRADE NOTES - PHP 5.3
- Firebird and SNMP support are no longer available on Windows. Firebird support
may be reintroduced in the future.
+=====================
+11.1 New in PHP 5.3.4
+=====================
+
+- open_basedir supports now symbolic links (checks the target).
+- is_link and SplFileInfo symbolic links related method are now fully supported
+ (on Windows Vista or later).
+
===================
12. New in PHP 5.3:
===================
View
23 UPGRADING.INTERNALS
@@ -0,0 +1,23 @@
+$Id$
+
+UPGRADE NOTES - PHP 5.3.4
+
+1. Internal API changes
+
+========================
+1. Internal API changes
+========================
+
+ a. stat/lstat support
+
+lstat is now available on all platforms. On unix-like platform
+php_sys_lstat is an alias to lstat (when avaible). On Windows it is now
+available using php_sys_lstat. php_sys_stat and php_sys_lstat usage is recommended
+instead of calling lstat directly, to ensure portability.
+
+ b. readlink support
+
+readlink is now available on all platforms. On unix-like platform
+php_sys_readlink is an alias to readlink (when avaible). On Windows it is now
+available using php_sys_readlink. php_sys_readlink usage is recommended
+instead of calling readlink directly, to ensure portability.
View
4 Zend/acinclude.m4
@@ -1,10 +1,10 @@
-dnl $Id: acinclude.m4 298893 2010-05-03 09:05:30Z pajoye $
+dnl $Id: acinclude.m4 304193 2010-10-07 21:44:41Z felipe $
dnl
dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions
- bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2"
+ bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
View
8 Zend/tests/bug45180.phpt
@@ -43,11 +43,11 @@ __call:
string(3) "ABC"
__call:
string(3) "ABC"
-__callstatic:
+__call:
string(3) "XYZ"
-__callstatic:
+__call:
string(3) "WWW"
-__callstatic:
+__call:
string(3) "ABC"
__callstatic:
string(1) "A"
@@ -58,4 +58,4 @@ string(1) "C"
__callstatic:
string(3) "FOO"
__callstatic:
-string(3) "FOO"
+string(3) "FOO"
View
8 Zend/tests/bug45186.phpt
@@ -35,17 +35,17 @@ call_user_func('self::y');
?>
--EXPECTF--
-__callstatic:
+__call:
string(3) "ABC"
-__callstatic:
+__call:
string(3) "ABC"
__call:
string(3) "xyz"
-__callstatic:
+__call:
string(3) "www"
__call:
string(1) "y"
-__callstatic:
+__call:
string(1) "y"
ok
__callstatic:
View
6 Zend/tests/bug51176.phpt
@@ -27,6 +27,6 @@ $foo->start();
?>
--EXPECT--
-static
-static
-static
+instance
+instance
+instance
View
35 Zend/tests/bug52361.phpt
@@ -0,0 +1,35 @@
+--TEST--
+Bug #52361 (Throwing an exception in a destructor causes invalid catching)
+--FILE--
+<?php
+class aaa {
+ public function __destruct() {
+ try {
+ throw new Exception(__CLASS__);
+ } catch(Exception $ex) {
+ echo "1. $ex\n";
+ }
+ }
+}
+function bbb() {
+ $a = new aaa();
+ throw new Exception(__FUNCTION__);
+}
+try {
+ bbb();
+ echo "must be skipped !!!";
+} catch(Exception $ex) {
+ echo "2. $ex\n";
+}
+?>
+--EXPECTF--
+1. exception 'Exception' with message 'aaa' in %sbug52361.php:5
+Stack trace:
+#0 %sbug52361.php(16): aaa->__destruct()
+#1 %sbug52361.php(16): bbb()
+#2 {main}
+2. exception 'Exception' with message 'bbb' in %sbug52361.php:13
+Stack trace:
+#0 %sbug52361.php(16): bbb()
+#1 {main}
+
View
19 Zend/tests/bug52484.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #52484 (__set() ignores setting properties with empty names)
+--FILE--
+<?php
+
+class A {
+ function __unset($prop) {
+ unset($this->$prop);
+ }
+}
+
+$a = new A();
+$prop = null;
+
+unset($a->$prop);
+
+?>
+--EXPECTF--
+Fatal error: Cannot access empty property in %s on line %d
View
19 Zend/tests/bug52484_2.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #52484.2 (__set() ignores setting properties with empty names)
+--FILE--
+<?php
+
+class A {
+ function __set($prop, $val) {
+ $this->$prop = $val;
+ }
+}
+
+$a = new A();
+$prop = null;
+
+$a->$prop = 2;
+
+?>
+--EXPECTF--
+Fatal error: Cannot access empty property in %s on line %d
View
19 Zend/tests/bug52484_3.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #52484.3 (__set() ignores setting properties with empty names)
+--FILE--
+<?php
+
+class A {
+ function __get($prop) {
+ var_dump($this->$prop);
+ }
+}
+
+$a = new A();
+$prop = null;
+
+var_dump($a->$prop);
+
+?>
+--EXPECTF--
+Fatal error: Cannot access empty property in %s on line %d
View
20 Zend/tests/bug52508.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #52508 (newline problem with parse_ini_file+INI_SCANNER_RAW)
+--FILE--
+<?php
+
+$file = dirname(__FILE__) .'/bug52508.ini';
+
+file_put_contents($file, "a = 1");
+
+$ini_array = parse_ini_file($file, true, INI_SCANNER_RAW);
+var_dump($ini_array);
+
+unlink($file);
+
+?>
+--EXPECT--
+array(1) {
+ ["a"]=>
+ string(1) "1"
+}
View
16 Zend/tests/bug52879.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #52879 (Objects unreferenced in __get, __set, __isset or __unset can be freed too early)
+--FILE--
+<?php
+class MyClass {
+ public $myRef;
+ public function __set($property,$value) {
+ $this->myRef = $value;
+ }
+}
+$myGlobal=new MyClass($myGlobal);
+$myGlobal->myRef=&$myGlobal;
+$myGlobal->myNonExistentProperty="ok\n";
+echo $myGlobal;
+--EXPECT--
+ok
View
40 Zend/tests/bug52939.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #52939 (zend_call_function_array does not respect ZEND_SEND_PREFER_REF)
+--FILE--
+<?php
+$ar1 = array("row1" => 2, "row2" => 1);
+var_dump(array_multisort($ar1));
+var_dump($ar1);
+
+$ar1 = array("row1" => 2, "row2" => 1);
+$args = array(&$ar1);
+var_dump(call_user_func_array("array_multisort", $args));
+var_dump($ar1);
+
+$ar1 = array("row1" => 2, "row2" => 1);
+$args = array($ar1);
+var_dump(call_user_func_array("array_multisort", $args));
+var_dump($ar1);
+?>
+--EXPECT--
+bool(true)
+array(2) {
+ ["row2"]=>
+ int(1)
+ ["row1"]=>
+ int(2)
+}
+bool(true)
+array(2) {
+ ["row2"]=>
+ int(1)
+ ["row1"]=>
+ int(2)
+}
+bool(true)
+array(2) {
+ ["row1"]=>
+ int(2)
+ ["row2"]=>
+ int(1)
+}
View
19 Zend/tests/bug53305.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #53305 (E_NOTICE when defining a constant starts with __COMPILER_HALT_OFFSET__)
+--FILE--
+<?php
+error_reporting(E_ALL);
+
+define('__COMPILER_HALT_OFFSET__1', 1);
+define('__COMPILER_HALT_OFFSET__2', 2);
+define('__COMPILER_HALT_OFFSET__', 3);
+define('__COMPILER_HALT_OFFSET__1'.chr(0), 4);
+
+var_dump(__COMPILER_HALT_OFFSET__1);
+var_dump(constant('__COMPILER_HALT_OFFSET__1'.chr(0)));
+
+?>
+--EXPECTF--
+Notice: Constant __COMPILER_HALT_OFFSET__ already defined in %s on line %d
+int(1)
+int(4)
View
10 Zend/tests/bug53632.phpt
@@ -0,0 +1,10 @@
+--TEST--
+zend_strtod() hangs with 2.2250738585072011e-308
+--FILE--
+<?php
+$d = 2.2250738585072011e-308;
+
+echo "Done\n";
+?>
+--EXPECTF--
+Done
View
4 Zend/tests/call_static_003.phpt
@@ -28,9 +28,9 @@ foo::BAZ();
--EXPECT--
nonstatic
string(6) "fOoBaR"
-static
+nonstatic
string(6) "foOBAr"
-static
+nonstatic
string(6) "fOOBAr"
static
string(3) "bAr"
View
2  Zend/tests/call_static_007.phpt
@@ -30,5 +30,5 @@ a::Foo();
--EXPECT--
__callstatic: Test
__call: Test
-__callstatic: Bar
+__call: Bar
__callstatic: Foo
View
6 Zend/tests/declare_001.phpt
@@ -1,5 +1,11 @@
--TEST--
Testing declare statement with several type values
+--SKIPIF--
+<?php
+if (in_array("detect_unicode", array_keys(ini_get_all()))) {
+ die("skip");
+}
+?>
--FILE--
<?php
View
40 Zend/tests/gc_032.phpt
@@ -0,0 +1,40 @@
+--TEST--
+GC 032: Crash in GC because of invalid reference counting
+--FILE--
+<?php
+$a = array();
+$b =& $a;
+$a[0] = $a;
+debug_zval_dump($a);
+$a = array(array());
+$b =& $a;
+$a[0][0] = $a;
+debug_zval_dump($a);
+?>
+--EXPECT--
+array(1) refcount(1){
+ [0]=>
+ array(1) refcount(3){
+ [0]=>
+ array(1) refcount(3){
+ [0]=>
+ *RECURSION*
+ }
+ }
+}
+array(1) refcount(1){
+ [0]=>
+ array(1) refcount(3){
+ [0]=>
+ array(1) refcount(1){
+ [0]=>
+ array(1) refcount(3){
+ [0]=>
+ array(1) refcount(1){
+ [0]=>
+ *RECURSION*
+ }
+ }
+ }
+ }
+}
View
BIN  Zend/tests/multibyte/multibyte_encoding_006.phpt
Binary file not shown
View
40 Zend/tests/objects_032.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Covariant return-by-ref constraints
+--FILE--
+<?php
+
+class A implements ArrayAccess {
+ public $foo = array();
+
+ public function &offsetGet($n) {
+ return $this->foo[$n];
+ }
+
+ public function offsetSet($n, $v) {
+ }
+ public function offsetUnset($n) {
+ }
+ public function offsetExists($n) {
+ }
+}
+
+$a = new A;
+
+$a['foo']['bar'] = 2;
+
+var_dump($a);
+
+?>
+==DONE==
+--EXPECTF--
+object(A)#1 (1) {
+ ["foo"]=>
+ array(1) {
+ ["foo"]=>
+ array(1) {
+ ["bar"]=>
+ int(2)