diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index a8805ab2b2b..f910ec5f2b6 100755
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -635,7 +635,12 @@ PHP_METHOD(Phar, webPhar)
return;
}
switch (Z_TYPE_P(retval_ptr)) {
- case IS_STRING :
+#if PHP_VERSION_ID >= 60000
+ case IS_UNICODE:
+ zval_unicode_to_string(retval_ptr TSRMLS_CC);
+ /* break intentionally omitted */
+#endif
+ case IS_STRING:
efree(entry);
if (fci.retval_ptr_ptr != &retval_ptr) {
entry = estrndup(Z_STRVAL_PP(fci.retval_ptr_ptr), Z_STRLEN_PP(fci.retval_ptr_ptr));
@@ -831,7 +836,12 @@ PHP_METHOD(Phar, webPhar)
RETURN_FALSE;
}
break;
- case IS_STRING :
+#if PHP_VERSION_ID >= 60000
+ case IS_UNICODE:
+ zval_unicode_to_string(*(val) TSRMLS_CC);
+ /* break intentionally omitted */
+#endif
+ case IS_STRING:
PHAR_SET_USER_MIME(PHAR_MIME_OTHER)
break;
default :
@@ -884,10 +894,18 @@ PHP_METHOD(Phar, mungServer)
zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to retrieve array value in Phar::mungServer()");
return;
}
+
+#if PHP_VERSION_ID >= 60000
+ if (Z_TYPE_PP(data) == IS_UNICODE) {
+ zval_unicode_to_string(*(data) TSRMLS_CC);
+ }
+#endif
+
if (Z_TYPE_PP(data) != IS_STRING) {
zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME");
return;
}
+
if (!php_self && Z_STRLEN_PP(data) == sizeof("PHP_SELF")-1 && !strncmp(Z_STRVAL_PP(data), "PHP_SELF", sizeof("PHP_SELF")-1)) {
if (SUCCESS != zend_hash_add_empty_element(&(PHAR_GLOBALS->phar_SERVER_mung_list), "PHP_SELF", sizeof("PHP_SELF")-1)) {
zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "Unable to add PHP_SELF to Phar::mungServer() list of values to mung");
@@ -1340,16 +1358,21 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
}
if (!value) {
/* failure in get_current_data */
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned no value", ce->name);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned no value", ce->name);
return ZEND_HASH_APPLY_STOP;
}
switch (Z_TYPE_PP(value)) {
- case IS_STRING :
+#if PHP_VERSION_ID >= 60000
+ case IS_UNICODE:
+ zval_unicode_to_string(*(value) TSRMLS_CC);
+ /* break intentionally omitted */
+#endif
+ case IS_STRING:
break;
- case IS_RESOURCE :
+ case IS_RESOURCE:
php_stream_from_zval_no_verify(fp, value);
if (!fp) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %s returned an invalid stream handle", ce->name);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returned an invalid stream handle", ce->name);
return ZEND_HASH_APPLY_STOP;
}
if (iter->funcs->get_current_key) {
@@ -1359,29 +1382,28 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
return ZEND_HASH_APPLY_STOP;
}
- PHAR_STR(key, str_key);
-
if (key_type == HASH_KEY_IS_LONG) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
return ZEND_HASH_APPLY_STOP;
}
+ PHAR_STR(key, str_key);
save = str_key;
if (str_key[str_key_len - 1] == '\0') str_key_len--;
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
return ZEND_HASH_APPLY_STOP;
}
close_fp = 0;
opened = (char *) estrndup(str, sizeof("[stream]") + 1);
goto after_open_fp;
- case IS_OBJECT :
+ case IS_OBJECT:
if (instanceof_function(Z_OBJCE_PP(value), spl_ce_SplFileInfo TSRMLS_CC)) {
char *test = NULL;
zval dummy;
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(*value TSRMLS_CC);
if (!base_len) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %s returns an SplFileInfo object, so base directory must be specified", ce->name);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ce->name);
return ZEND_HASH_APPLY_STOP;
}
switch (intern->type) {
@@ -1411,7 +1433,11 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
goto phar_spl_fileinfo;
case SPL_FS_INFO:
case SPL_FS_FILE:
+#if PHP_VERSION_ID >= 60000
fname = expand_filepath(intern->file_name.s, NULL TSRMLS_CC);
+#else
+ fname = expand_filepath(intern->file_name, NULL TSRMLS_CC);
+#endif
fname_len = strlen(fname);
save = fname;
is_splfileinfo = 1;
@@ -1420,7 +1446,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{
}
/* fall-through */
default :
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid value (must return a string)", ce->name);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid value (must return a string)", ce->name);
return ZEND_HASH_APPLY_STOP;
}
@@ -1447,7 +1473,7 @@ phar_spl_fileinfo:
str_key_len--;
}
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a path \"%s\" that is not in the base directory \"%s\"", ce->name, fname, base);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that is not in the base directory \"%s\"", ce->name, fname, base);
if (save) {
efree(save);
efree(temp);
@@ -1462,22 +1488,21 @@ phar_spl_fileinfo:
return ZEND_HASH_APPLY_STOP;
}
- PHAR_STR(key, str_key);
-
if (key_type == HASH_KEY_IS_LONG) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
return ZEND_HASH_APPLY_STOP;
}
+ PHAR_STR(key, str_key);
save = str_key;
if (str_key[str_key_len - 1] == '\0') str_key_len--;
} else {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned an invalid key (must return a string)", ce->name);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned an invalid key (must return a string)", ce->name);
return ZEND_HASH_APPLY_STOP;
}
}
#if PHP_MAJOR_VERSION < 6
if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a path \"%s\" that safe mode prevents opening", ce->name, fname);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that safe mode prevents opening", ce->name, fname);
if (save) {
efree(save);
}
@@ -1489,7 +1514,7 @@ phar_spl_fileinfo:
#endif
if (php_check_open_basedir(fname TSRMLS_CC)) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a path \"%s\" that open_basedir prevents opening", ce->name, fname);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a path \"%s\" that open_basedir prevents opening", ce->name, fname);
if (save) {
efree(save);
}
@@ -1502,7 +1527,7 @@ phar_spl_fileinfo:
/* try to open source file, then create internal phar file and copy contents */
fp = php_stream_open_wrapper(fname, "rb", STREAM_MUST_SEEK|0, &opened);
if (!fp) {
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %s returned a file that could not be opened \"%s\"", ce->name, fname);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Iterator %v returned a file that could not be opened \"%s\"", ce->name, fname);
if (save) {
efree(save);
}
@@ -3789,6 +3814,11 @@ PHP_METHOD(Phar, extractTo)
switch (Z_TYPE_P(zval_files)) {
case IS_NULL:
goto all_files;
+#if PHP_VERSION_ID >= 60000
+ case IS_UNICODE:
+ zval_unicode_to_string(zval_files TSRMLS_CC);
+ /* break intentionally omitted */
+#endif
case IS_STRING:
filename = Z_STRVAL_P(zval_files);
filename_len = Z_STRLEN_P(zval_files);
@@ -3802,6 +3832,11 @@ PHP_METHOD(Phar, extractTo)
zval **zval_file;
if (zend_hash_index_find(Z_ARRVAL_P(zval_files), i, (void **) &zval_file) == SUCCESS) {
switch (Z_TYPE_PP(zval_file)) {
+#if PHP_VERSION_ID >= 60000
+ case IS_UNICODE:
+ zval_unicode_to_string(*(zval_file) TSRMLS_CC);
+ /* break intentionally omitted */
+#endif
case IS_STRING:
break;
default:
diff --git a/ext/phar/shortarc.php b/ext/phar/shortarc.php
index 748afeda2e2..1bf3baa8aa1 100644
--- a/ext/phar/shortarc.php
+++ b/ext/phar/shortarc.php
@@ -114,15 +114,15 @@ class Extract_Phar
{
$fp = fopen(__FILE__, 'rb');
fseek($fp, self::LEN);
- $L = unpack('V', $a = fread($fp, 4));
- $m = '';
+ $L = unpack('V', $a = (binary)fread($fp, 4));
+ $m = (binary)'';
do {
$read = 8192;
if ($L[1] - strlen($m) < 8192) {
$read = $L[1] - strlen($m);
}
- $last = fread($fp, $read);
+ $last = (binary)fread($fp, $read);
$m .= $last;
} while (strlen($last) && strlen($m) < $L[1]);
diff --git a/ext/phar/stub.h b/ext/phar/stub.h
index 104a8baa639..2a1cbe6c096 100644
--- a/ext/phar/stub.h
+++ b/ext/phar/stub.h
@@ -24,10 +24,11 @@ static inline void phar_get_stub(const char *index_php, const char *web, size_t
static const char newstub1_0[] = "';\n\nif (in_array('phar', stream_get_wrappers()) && class_exists('Phar', 0)) {\nPhar::interceptFileFuncs();\nset_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path());\nPhar::webPhar(null, $web);\ninclude 'phar://' . __FILE__ . '/' . Extract_Phar::START;\nreturn;\n}\n\nif (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'POST'))) {\nExtract_Phar::go(true);\n$mimes = array(\n'phps' => 2,\n'c' => 'text/plain',\n'cc' => 'text/plain',\n'cpp' => 'text/plain',\n'c++' => 'text/plain',\n'dtd' => 'text/plain',\n'h' => 'text/plain',\n'log' => 'text/plain',\n'rng' => 'text/plain',\n'txt' => 'text/plain',\n'xsd' => 'text/plain',\n'php' => 1,\n'inc' => 1,\n'avi' => 'video/avi',\n'bmp' => 'image/bmp',\n'css' => 'text/css',\n'gif' => 'image/gif',\n'htm' => 'text/html',\n'html' => 'text/html',\n'htmls' => 'text/html',\n'ico' => 'image/x-ico',\n'jpe' => 'image/jpeg',\n'jpg' => 'image/jpeg',\n'jpeg' => 'image/jpeg',\n'js' => 'application/x-javascript',\n'midi' => 'audio/midi',\n'mid' => 'audio/midi',\n'mod' => 'audio/mod',\n'mov' => 'movie/quicktime',\n'mp3' => 'audio/mp3',\n'mpg' => 'video/mpeg',\n'mpeg' => 'video/mpeg',\n'pdf' => 'application/pdf',\n'png' => 'image/png',\n'swf' => 'application/shockwave-flash',\n'tif' => 'image/tiff',\n'tiff' => 'image/tiff',\n'wav' => 'audio/wav',\n'xbm' => 'image/xbm',\n'xml' => 'text/xml',\n);\n\nheader(\"Cache-Control: no-cache, must-revalidate\");\nheader(\"Pragma: no-cache\");\n\n$basename = basename(__FILE__);\nif (!strpos($_SERVER['REQUEST_URI'], $basename)) {\nchdir(Extract_Phar::$temp);\ninclude $web;\nreturn;\n}\n$pt = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], $basename) + strlen($basename));\nif (!$pt || $pt == '/') {\n$pt = $web;\nheader('HTTP/1.1 301 Moved Permanently');\nheader('Location: ' . $_SERVER['REQUEST_URI'] . '/' . $pt);\nexit;\n}\n$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);\nif (!$a || strlen(dirname($a)) < strlen(";
static const char newstub1_1[] = "Extract_Phar::$temp)) {\nheader('HTTP/1.0 404 Not Found');\necho \"\\n
\\n File Not Found\\n \\n \\n 404 - File \", $pt, \" Not Found
\\n \\n\";\nexit;\n}\n$b = pathinfo($a);\nif (!isset($b['extension'])) {\nheader('Content-Type: text/plain');\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\nif (isset($mimes[$b['extension']])) {\nif ($mimes[$b['extension']] === 1) {\ninclude $a;\nexit;\n}\nif ($mimes[$b['extension']] === 2) {\nhighlight_file($a);\nexit;\n}\nheader('Content-Type: ' .$mimes[$b['extension']]);\nheader('Content-Length: ' . filesize($a));\nreadfile($a);\nexit;\n}\n}\n\nclass Extract_Phar\n{\nstatic $temp;\nstatic $origdir;\nconst GZ = 0x1000;\nconst BZ2 = 0x2000;\nconst MASK = 0x3000;\nconst START = '";
static const char newstub2[] = "';\nconst LEN = ";
- static const char newstub3_0[] = ";\n\nstatic function go($return = false)\n{\n$fp = fopen(__FILE__, 'rb');\nfseek($fp, self::LEN);\n$L = unpack('V', $a = fread($fp, 4));\n$m = '';\n\ndo {\n$read = 8192;\nif ($L[1] - strlen($m) < 8192) {\n$read = $L[1] - strlen($m);\n}\n$last = fread($fp, $read);\n$m .= $last;\n} while (strlen($last) && strlen($m) < $L[1]);\n\nif (strlen($m) < $L[1]) {\ndie('ERROR: manifest length read was \"' .\nstrlen($m) .'\" should be \"' .\n$L[1] . '\"');\n}\n\n$info = self::_unpack($m);\n$f = $info['c'];\n\nif ($f & self::GZ) {\nif (!function_exists('gzinflate')) {\ndie('Error: zlib extension is not enabled -' .\n' gzinflate() function needed for zlib-compressed .phars');\n}\n}\n\nif ($f & self::BZ2) {\nif (!function_exists('bzdecompress')) {\ndie('Error: bzip2 extension is not enabled -' .\n' bzdecompress() function needed for bz2-compressed .phars');\n}\n}\n\n$temp = self::tmpdir();\n\nif (!$temp || !is_writable($temp)) {\n$sessionpath = session_save_path();\nif (strpos ($sessionpath, \";\") !== false)\n$sessionpath = substr ($sessionpath, strpos ($sessionpath, \";\")+1);\nif (!file_exists($sessionpath) || !is_dir($sessionpath)) {\ndie('Could not locate temporary directory to extract phar');\n}\n$temp = $sessionpath;\n}\n\n$temp .= '/pharextract/'.basename(__FILE__, '.phar');\nself::$temp = $temp;\nself::$origdir = getcwd();\n@mkdir($temp, 0777, true);\n$temp = realpath($temp);\n\nif (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) {\nself::_removeTmpFiles($temp, getcwd());\n@mkdir($temp, 0777, true);\n@file_put_contents($temp . '/' . md5_file(__FILE__), '');\n\nforeach ($info['m'] as $path => $file) {\n$a = !file_exists(dirname($temp . '/' . $path));\n@mkdir(dirname($temp . '/' . $path), 0777, true);\nclearstatcache();\n\nif ($path[strlen($path) - 1] == '/') {\n@mkdir($temp . '/' . $path, 0777);\n} else {\nfile_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp));\n@chmod($temp . '/' . $path, 0666);\n}\n}\n}\n\nchdir($temp);\n\nif (!$return) {\ninclude self::START;\n}\n}\n\nstatic fun";
- static const char newstub3_1[] = "ction tmpdir()\n{\nif (strpos(PHP_OS, 'WIN') !== false) {\nif ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) {\nreturn $var;\n}\nif (is_dir('/temp') || mkdir('/temp')) {\nreturn realpath('/temp');\n}\nreturn false;\n}\nif ($var = getenv('TMPDIR')) {\nreturn $var;\n}\nreturn realpath('/tmp');\n}\n\nstatic function _unpack($m)\n{\n$info = unpack('V', substr($m, 0, 4));\n $l = unpack('V', substr($m, 10, 4));\n$m = substr($m, 14 + $l[1]);\n$s = unpack('V', substr($m, 0, 4));\n$o = 0;\n$start = 4 + $s[1];\n$ret['c'] = 0;\n\nfor ($i = 0; $i < $info[1]; $i++) {\n $len = unpack('V', substr($m, $start, 4));\n$start += 4;\n $savepath = substr($m, $start, $len[1]);\n$start += $len[1];\n $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24)));\n$ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3]\n& 0xffffffff);\n$ret['m'][$savepath][7] = $o;\n$o += $ret['m'][$savepath][2];\n$start += 24 + $ret['m'][$savepath][5];\n$ret['c'] |= $ret['m'][$savepath][4] & self::MASK;\n}\nreturn $ret;\n}\n\nstatic function extractFile($path, $entry, $fp)\n{\n$data = '';\n$c = $entry[2];\n\nwhile ($c) {\nif ($c < 8192) {\n$data .= @fread($fp, $c);\n$c = 0;\n} else {\n$c -= 8192;\n$data .= @fread($fp, 8192);\n}\n}\n\nif ($entry[4] & self::GZ) {\n$data = gzinflate($data);\n} elseif ($entry[4] & self::BZ2) {\n$data = bzdecompress($data);\n}\n\nif (strlen($data) != $entry[0]) {\ndie(\"Invalid internal .phar file (size error \" . strlen($data) . \" != \" .\n$stat[7] . \")\");\n}\n\nif ($entry[3] != sprintf(\"%u\", crc32((binary)$data) & 0xffffffff)) {\ndie(\"Invalid internal .phar file (checksum error)\");\n}\n\nreturn $data;\n}\n\nstatic function _removeTmpFiles($temp, $origdir)\n{\nchdir($temp);\n\nforeach (glob('*') as $f) {\nif (file_exists($f)) {\nis_dir($f) ? @rmdir($f) : @unlink($f);\nif (file_exists($f) && is_dir($f)) {\nself::_removeTmpFiles($f, getcwd());\n}\n}\n}\n\n@rmdir($temp);\nclearstatcache();\nchdir($origdir);\n}\n}\n\nExtract_Phar::go();\n__HALT_COMPILER(); ?>";
+ static const char newstub3_0[] = ";\n\nstatic function go($return = false)\n{\n$fp = fopen(__FILE__, 'rb');\nfseek($fp, self::LEN);\n$L = unpack('V', $a = (binary)fread($fp, 4));\n$m = (binary)'';\n\ndo {\n$read = 8192;\nif ($L[1] - strlen($m) < 8192) {\n$read = $L[1] - strlen($m);\n}\n$last = (binary)fread($fp, $read);\n$m .= $last;\n} while (strlen($last) && strlen($m) < $L[1]);\n\nif (strlen($m) < $L[1]) {\ndie('ERROR: manifest length read was \"' .\nstrlen($m) .'\" should be \"' .\n$L[1] . '\"');\n}\n\n$info = self::_unpack($m);\n$f = $info['c'];\n\nif ($f & self::GZ) {\nif (!function_exists('gzinflate')) {\ndie('Error: zlib extension is not enabled -' .\n' gzinflate() function needed for zlib-compressed .phars');\n}\n}\n\nif ($f & self::BZ2) {\nif (!function_exists('bzdecompress')) {\ndie('Error: bzip2 extension is not enabled -' .\n' bzdecompress() function needed for bz2-compressed .phars');\n}\n}\n\n$temp = self::tmpdir();\n\nif (!$temp || !is_writable($temp)) {\n$sessionpath = session_save_path();\nif (strpos ($sessionpath, \";\") !== false)\n$sessionpath = substr ($sessionpath, strpos ($sessionpath, \";\")+1);\nif (!file_exists($sessionpath) || !is_dir($sessionpath)) {\ndie('Could not locate temporary directory to extract phar');\n}\n$temp = $sessionpath;\n}\n\n$temp .= '/pharextract/'.basename(__FILE__, '.phar');\nself::$temp = $temp;\nself::$origdir = getcwd();\n@mkdir($temp, 0777, true);\n$temp = realpath($temp);\n\nif (!file_exists($temp . DIRECTORY_SEPARATOR . md5_file(__FILE__))) {\nself::_removeTmpFiles($temp, getcwd());\n@mkdir($temp, 0777, true);\n@file_put_contents($temp . '/' . md5_file(__FILE__), '');\n\nforeach ($info['m'] as $path => $file) {\n$a = !file_exists(dirname($temp . '/' . $path));\n@mkdir(dirname($temp . '/' . $path), 0777, true);\nclearstatcache();\n\nif ($path[strlen($path) - 1] == '/') {\n@mkdir($temp . '/' . $path, 0777);\n} else {\nfile_put_contents($temp . '/' . $path, self::extractFile($path, $file, $fp));\n@chmod($temp . '/' . $path, 0666);\n}\n}\n}\n\nchdir($temp);\n\nif (!$return) {\ninclude self::ST";
+ static const char newstub3_1[] = "ART;\n}\n}\n\nstatic function tmpdir()\n{\nif (strpos(PHP_OS, 'WIN') !== false) {\nif ($var = getenv('TMP') ? getenv('TMP') : getenv('TEMP')) {\nreturn $var;\n}\nif (is_dir('/temp') || mkdir('/temp')) {\nreturn realpath('/temp');\n}\nreturn false;\n}\nif ($var = getenv('TMPDIR')) {\nreturn $var;\n}\nreturn realpath('/tmp');\n}\n\nstatic function _unpack($m)\n{\n$info = unpack('V', substr($m, 0, 4));\n $l = unpack('V', substr($m, 10, 4));\n$m = substr($m, 14 + $l[1]);\n$s = unpack('V', substr($m, 0, 4));\n$o = 0;\n$start = 4 + $s[1];\n$ret['c'] = 0;\n\nfor ($i = 0; $i < $info[1]; $i++) {\n $len = unpack('V', substr($m, $start, 4));\n$start += 4;\n $savepath = substr($m, $start, $len[1]);\n$start += $len[1];\n $ret['m'][$savepath] = array_values(unpack('Va/Vb/Vc/Vd/Ve/Vf', substr($m, $start, 24)));\n$ret['m'][$savepath][3] = sprintf('%u', $ret['m'][$savepath][3]\n& 0xffffffff);\n$ret['m'][$savepath][7] = $o;\n$o += $ret['m'][$savepath][2];\n$start += 24 + $ret['m'][$savepath][5];\n$ret['c'] |= $ret['m'][$savepath][4] & self::MASK;\n}\nreturn $ret;\n}\n\nstatic function extractFile($path, $entry, $fp)\n{\n$data = '';\n$c = $entry[2];\n\nwhile ($c) {\nif ($c < 8192) {\n$data .= @fread($fp, $c);\n$c = 0;\n} else {\n$c -= 8192;\n$data .= @fread($fp, 8192);\n}\n}\n\nif ($entry[4] & self::GZ) {\n$data = gzinflate($data);\n} elseif ($entry[4] & self::BZ2) {\n$data = bzdecompress($data);\n}\n\nif (strlen($data) != $entry[0]) {\ndie(\"Invalid internal .phar file (size error \" . strlen($data) . \" != \" .\n$stat[7] . \")\");\n}\n\nif ($entry[3] != sprintf(\"%u\", crc32((binary)$data) & 0xffffffff)) {\ndie(\"Invalid internal .phar file (checksum error)\");\n}\n\nreturn $data;\n}\n\nstatic function _removeTmpFiles($temp, $origdir)\n{\nchdir($temp);\n\nforeach (glob('*') as $f) {\nif (file_exists($f)) {\nis_dir($f) ? @rmdir($f) : @unlink($f);\nif (file_exists($f) && is_dir($f)) {\nself::_removeTmpFiles($f, getcwd());\n}\n}\n}\n\n@rmdir($temp);\nclearstatcache();\nchdir($origdir);\n}\n}\n\nExtract_Phar::go();\n__HALT_COMPIL";
+ static const char newstub3_2[] = "ER(); ?>";
- static const int newstub_len = 6641;
+ static const int newstub_len = 6665;
- *len = spprintf(stub, name_len + web_len + newstub_len, "%s%s%s%s%s%s%d%s%s", newstub0, web, newstub1_0, newstub1_1, index_php, newstub2, name_len + web_len + newstub_len, newstub3_0, newstub3_1);
+ *len = spprintf(stub, name_len + web_len + newstub_len, "%s%s%s%s%s%s%d%s%s%s", newstub0, web, newstub1_0, newstub1_1, index_php, newstub2, name_len + web_len + newstub_len, newstub3_0, newstub3_1, newstub3_2);
}
diff --git a/ext/phar/tests/008.phpt b/ext/phar/tests/008.phpt
index 664ffea5cb4..366a4c6d6d5 100644
--- a/ext/phar/tests/008.phpt
+++ b/ext/phar/tests/008.phpt
@@ -4,10 +4,10 @@ Phar::mapPhar truncated manifest (not enough for manifest length)
--FILE--
";
-$file .= pack('V', 500) . 'notenough';
+$file .= pack('V', 500) . (binary)'notenough';
file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
try {
include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
diff --git a/ext/phar/tests/009.phpt b/ext/phar/tests/009.phpt
index c80445d61b4..42bdf1d1e7e 100644
--- a/ext/phar/tests/009.phpt
+++ b/ext/phar/tests/009.phpt
@@ -6,10 +6,10 @@ Phar::mapPhar too many manifest entries
phar.require_hash=0
--FILE--
";
-$file .= pack('VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) . str_repeat('A', 500);
+$file .= pack('VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) . (binary)str_repeat('A', 500);
file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
try {
include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
diff --git a/ext/phar/tests/010.phpt b/ext/phar/tests/010.phpt
index bfeb435362a..aff6d694d93 100644
--- a/ext/phar/tests/010.phpt
+++ b/ext/phar/tests/010.phpt
@@ -6,14 +6,14 @@ Phar::mapPhar buffer overrun
phar.require_hash=0
--FILE--
";
// this fails because the manifest length does not include the other 10 byte manifest data
-$manifest = pack('V', 1) . 'a' . pack('VVVVVV', 0, time(), 0, crc32((binary)''), 0x00000000, 0);
-$file .= pack('VVnVV', strlen($manifest), 1, 0x1000, 0x00000000, 3) . 'hio' . pack('V', 0) . $manifest;
+$manifest = pack('V', 1) . (binary)'a' . pack('VVVVVV', 0, time(), 0, crc32((binary)''), 0x00000000, 0);
+$file .= pack('VVnVV', strlen($manifest), 1, 0x1000, 0x00000000, 3) . (binary)'hio' . pack('V', 0) . (binary)$manifest;
file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
try {
diff --git a/ext/phar/tests/011.phpt b/ext/phar/tests/011.phpt
index 8e76bdce157..a0f5b2d8498 100644
--- a/ext/phar/tests/011.phpt
+++ b/ext/phar/tests/011.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
diff --git a/ext/phar/tests/012.phpt b/ext/phar/tests/012.phpt
index 3246eff468a..f079d77c8f2 100644
--- a/ext/phar/tests/012.phpt
+++ b/ext/phar/tests/012.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
-$file = "";
diff --git a/ext/phar/tests/013.phpt b/ext/phar/tests/013.phpt
index ae3ae729364..02c53b802f6 100644
--- a/ext/phar/tests/013.phpt
+++ b/ext/phar/tests/013.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
+$file = (binary)"";
// filesize should be 1, and is 2
$files = array();
diff --git a/ext/phar/tests/014.phpt b/ext/phar/tests/014.phpt
index 1a20086ffa0..7866c08af2a 100644
--- a/ext/phar/tests/014.phpt
+++ b/ext/phar/tests/014.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
+$file = (binary)"";
// wrong crc32
$files = array();
diff --git a/ext/phar/tests/015.phpt b/ext/phar/tests/015.phpt
index b93b77e9fbc..a8425205fa0 100644
--- a/ext/phar/tests/015.phpt
+++ b/ext/phar/tests/015.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
";
+$file = (binary)"";
$files = array();
$files['a'] = array('cont'=>'a','comp'=>chr(75) . chr(4) . chr(0) /* 'a' gzdeflated */, 'flags'=>0x00001000);
diff --git a/ext/phar/tests/015b.phpt b/ext/phar/tests/015b.phpt
index 08ead2d9c00..e2578bf6499 100755
--- a/ext/phar/tests/015b.phpt
+++ b/ext/phar/tests/015b.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
";
+$file = (binary)"";
$files = array();
$files['a'] = array('cont'=>'Hello World', 'comp'=>pack('H*', '425a6834314159265359065c89da0000009780400000400080060490002000310c082031a916c41d41e2ee48a70a1200cb913b40'),'flags'=>0x00002000);
diff --git a/ext/phar/tests/016.phpt b/ext/phar/tests/016.phpt
index 302d06d3cb3..7fbcb80e071 100644
--- a/ext/phar/tests/016.phpt
+++ b/ext/phar/tests/016.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
";
+$file = (binary)"";
// file length is too short
$files = array();
diff --git a/ext/phar/tests/016b.phpt b/ext/phar/tests/016b.phpt
index 8fe66826d6d..e3876883145 100755
--- a/ext/phar/tests/016b.phpt
+++ b/ext/phar/tests/016b.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
";
+$file = (binary)"";
// file length is too short
$files = array();
diff --git a/ext/phar/tests/017.phpt b/ext/phar/tests/017.phpt
index ec012eaa113..0915708ebcd 100644
--- a/ext/phar/tests/017.phpt
+++ b/ext/phar/tests/017.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
diff --git a/ext/phar/tests/018.phpt b/ext/phar/tests/018.phpt
index 97cd323779b..320356fd4dc 100644
--- a/ext/phar/tests/018.phpt
+++ b/ext/phar/tests/018.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
@@ -19,10 +19,12 @@ include 'files/phar_test.inc';
include $fname;
$dir = opendir('phar://hio/');
+
while (false !== ($a = readdir($dir))) {
var_dump($a);
var_dump(is_dir('phar://hio/' . $a));
}
+
?>
--CLEAN--
diff --git a/ext/phar/tests/019.phpt b/ext/phar/tests/019.phpt
index 3d00b5f8e91..f9cff347efd 100644
--- a/ext/phar/tests/019.phpt
+++ b/ext/phar/tests/019.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
diff --git a/ext/phar/tests/019b.phpt b/ext/phar/tests/019b.phpt
index 574919b7938..e3d1f7672dc 100755
--- a/ext/phar/tests/019b.phpt
+++ b/ext/phar/tests/019b.phpt
@@ -2,13 +2,14 @@
Phar: opendir test, recurse into
--SKIPIF--
+
--INI--
phar.require_hash=0
--FILE--
";
diff --git a/ext/phar/tests/019c.phpt b/ext/phar/tests/019c.phpt
index 242b6668712..ed5527e1c3f 100755
--- a/ext/phar/tests/019c.phpt
+++ b/ext/phar/tests/019c.phpt
@@ -2,13 +2,14 @@
Phar: opendir test, recurse into
--SKIPIF--
+
--INI--
phar.require_hash=0
--FILE--
";
diff --git a/ext/phar/tests/020.phpt b/ext/phar/tests/020.phpt
index b06cdbf7312..4587d5210b6 100644
--- a/ext/phar/tests/020.phpt
+++ b/ext/phar/tests/020.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
@@ -53,31 +53,31 @@ array(26) {
int(-1)
[12]=>
int(-1)
- ["dev"]=>
+ [u"dev"]=>
int(12)
- ["ino"]=>
+ [u"ino"]=>
int(%d)
- ["mode"]=>
+ [u"mode"]=>
int(33060)
- ["nlink"]=>
+ [u"nlink"]=>
int(1)
- ["uid"]=>
+ [u"uid"]=>
int(0)
- ["gid"]=>
+ [u"gid"]=>
int(0)
- ["rdev"]=>
+ [u"rdev"]=>
int(-1)
- ["size"]=>
+ [u"size"]=>
int(1)
- ["atime"]=>
+ [u"atime"]=>
int(%d)
- ["mtime"]=>
+ [u"mtime"]=>
int(%d)
- ["ctime"]=>
+ [u"ctime"]=>
int(%d)
- ["blksize"]=>
+ [u"blksize"]=>
int(-1)
- ["blocks"]=>
+ [u"blocks"]=>
int(-1)
}
array(26) {
@@ -107,30 +107,30 @@ array(26) {
int(-1)
[12]=>
int(-1)
- ["dev"]=>
+ [u"dev"]=>
int(12)
- ["ino"]=>
+ [u"ino"]=>
int(%d)
- ["mode"]=>
+ [u"mode"]=>
int(16749)
- ["nlink"]=>
+ [u"nlink"]=>
int(1)
- ["uid"]=>
+ [u"uid"]=>
int(0)
- ["gid"]=>
+ [u"gid"]=>
int(0)
- ["rdev"]=>
+ [u"rdev"]=>
int(-1)
- ["size"]=>
+ [u"size"]=>
int(0)
- ["atime"]=>
+ [u"atime"]=>
int(%d)
- ["mtime"]=>
+ [u"mtime"]=>
int(%d)
- ["ctime"]=>
+ [u"ctime"]=>
int(%d)
- ["blksize"]=>
+ [u"blksize"]=>
int(-1)
- ["blocks"]=>
+ [u"blocks"]=>
int(-1)
}
\ No newline at end of file
diff --git a/ext/phar/tests/021.phpt b/ext/phar/tests/021.phpt
index 9c9cd975688..a0d74fb2fe2 100644
--- a/ext/phar/tests/021.phpt
+++ b/ext/phar/tests/021.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
@@ -56,30 +56,30 @@ array(26) {
int(-1)
[12]=>
int(-1)
- ["dev"]=>
+ [u"dev"]=>
int(12)
- ["ino"]=>
+ [u"ino"]=>
int(%d)
- ["mode"]=>
+ [u"mode"]=>
int(33060)
- ["nlink"]=>
+ [u"nlink"]=>
int(1)
- ["uid"]=>
+ [u"uid"]=>
int(0)
- ["gid"]=>
+ [u"gid"]=>
int(0)
- ["rdev"]=>
+ [u"rdev"]=>
int(-1)
- ["size"]=>
+ [u"size"]=>
int(1)
- ["atime"]=>
+ [u"atime"]=>
int(%d)
- ["mtime"]=>
+ [u"mtime"]=>
int(%d)
- ["ctime"]=>
+ [u"ctime"]=>
int(%d)
- ["blksize"]=>
+ [u"blksize"]=>
int(-1)
- ["blocks"]=>
+ [u"blocks"]=>
int(-1)
-}
\ No newline at end of file
+}
diff --git a/ext/phar/tests/022.phpt b/ext/phar/tests/022.phpt
index 20c24a02143..4c02d6342c6 100644
--- a/ext/phar/tests/022.phpt
+++ b/ext/phar/tests/022.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
diff --git a/ext/phar/tests/023.phpt b/ext/phar/tests/023.phpt
index 808f91deaef..205b1ed57ca 100755
--- a/ext/phar/tests/023.phpt
+++ b/ext/phar/tests/023.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
+$file = (binary)"";
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/024.phpt b/ext/phar/tests/024.phpt
index ad30d2644d5..3bf0b5f0087 100755
--- a/ext/phar/tests/024.phpt
+++ b/ext/phar/tests/024.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
+$file = (binary)"";
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/025.phpt b/ext/phar/tests/025.phpt
index bbb5bc4e83c..8ad434a5c44 100755
--- a/ext/phar/tests/025.phpt
+++ b/ext/phar/tests/025.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
+$file = (binary)"";
$files = array();
$files['a'] = '';
diff --git a/ext/phar/tests/026.phpt b/ext/phar/tests/026.phpt
index 696fbcf415a..16a4d875546 100755
--- a/ext/phar/tests/026.phpt
+++ b/ext/phar/tests/026.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
";
+$file = (binary)"";
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/027.phpt b/ext/phar/tests/027.phpt
index 679fefc2cd0..0bc36f4f6d2 100755
--- a/ext/phar/tests/027.phpt
+++ b/ext/phar/tests/027.phpt
@@ -2,13 +2,14 @@
Phar: phar:// opendir
--SKIPIF--
+
--INI--
phar.require_hash=0
--FILE--
";
+$file = (binary)"";
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/028.phpt b/ext/phar/tests/028.phpt
index 087f822777f..a49e9389424 100755
--- a/ext/phar/tests/028.phpt
+++ b/ext/phar/tests/028.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
';
+$file = (binary)'';
$alias = '';
$files = array();
diff --git a/ext/phar/tests/029.phpt b/ext/phar/tests/029.phpt
index 41fcec03e7f..4005e940963 100755
--- a/ext/phar/tests/029.phpt
+++ b/ext/phar/tests/029.phpt
@@ -11,7 +11,7 @@ $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.php';
$fname = $fname1;
$alias = '';
$pname = 'phar://hio';
-$file = '';
+$file = (binary)'';
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/030.phpt b/ext/phar/tests/030.phpt
index e1e94dba80d..806da2c51ea 100755
--- a/ext/phar/tests/030.phpt
+++ b/ext/phar/tests/030.phpt
@@ -8,7 +8,7 @@ phar.require_hash=0
';
+$file = (binary)'';
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/033.phpt b/ext/phar/tests/033.phpt
index d53c7f52fa8..5536c4d3c1a 100644
--- a/ext/phar/tests/033.phpt
+++ b/ext/phar/tests/033.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
';
+$file = (binary)'';
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/033a.phpt b/ext/phar/tests/033a.phpt
index e8725bdda63..13067b4506f 100644
--- a/ext/phar/tests/033a.phpt
+++ b/ext/phar/tests/033a.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
';
+$file = (binary)'';
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt
index c644424d25a..9d331652f74 100644
--- a/ext/phar/tests/badparameters.phpt
+++ b/ext/phar/tests/badparameters.phpt
@@ -134,35 +134,35 @@ echo $e->getMessage() . "\n";
?>
===DONE===
--EXPECTF--
-Warning: Phar::mungServer() expects parameter 1 to be array, string given in %sbadparameters.php on line %d
+Warning: Phar::mungServer() expects parameter 1 to be array, Unicode string given in %sbadparameters.php on line %d
-Warning: Phar::createDefaultStub() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::createDefaultStub() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
-Warning: Phar::loadPhar() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::loadPhar() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
-Warning: Phar::canCompress() expects parameter 1 to be long, string given in %sbadparameters.php on line %d
+Warning: Phar::canCompress() expects parameter 1 to be long, Unicode string given in %sbadparameters.php on line %d
-Warning: Phar::__construct() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::__construct() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
Warning: Phar::convertToExecutable() expects parameter 1 to be long, array given in %sbadparameters.php on line %d
Warning: Phar::convertToData() expects parameter 1 to be long, array given in %sbadparameters.php on line %d
-Warning: PharData::delete() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: PharData::delete() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
Cannot write out phar archive, phar is read-only
Entry oops does not exist and cannot be deleted
%sfiles/frontcontroller10.phar
Cannot write out phar archive, phar is read-only
A Phar alias cannot be set in a plain tar archive
-Warning: Phar::setAlias() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::setAlias() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
Cannot change stub, phar is read-only
A Phar stub cannot be set in a plain tar archive
-Warning: Phar::setStub() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::setStub() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
A Phar stub cannot be set in a plain tar archive
-Warning: Phar::setDefaultStub() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::setDefaultStub() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
Cannot change stub: phar.readonly=1
Cannot set signature algorithm, phar is read-only
Cannot set signature algorithm, not possible with tar-based phar archives
@@ -177,18 +177,18 @@ Phar is readonly, cannot change compression
Warning: Phar::copy() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d
Cannot copy "a" to "b", phar is read-only
-Warning: Phar::offsetExists() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::offsetExists() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
-Warning: Phar::offsetGet() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::offsetGet() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
Warning: Phar::offsetSet() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d
-Warning: PharData::offsetUnset() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: PharData::offsetUnset() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
Write operations disabled by INI setting
-Warning: Phar::addEmptyDir() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::addEmptyDir() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
-Warning: Phar::addFile() expects parameter 1 to be string, array given in %sbadparameters.php on line %d
+Warning: Phar::addFile() expects parameter 1 to be binary string, array given in %sbadparameters.php on line %d
Warning: Phar::addFromString() expects exactly 2 parameters, 1 given in %sbadparameters.php on line %d
Write operations disabled by INI setting
diff --git a/ext/phar/tests/delete.phpt b/ext/phar/tests/delete.phpt
index 1d985090645..6c97898dfdc 100644
--- a/ext/phar/tests/delete.phpt
+++ b/ext/phar/tests/delete.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
";
diff --git a/ext/phar/tests/delete_in_phar.phpt b/ext/phar/tests/delete_in_phar.phpt
index 4842d279133..adbb95ef7ae 100644
--- a/ext/phar/tests/delete_in_phar.phpt
+++ b/ext/phar/tests/delete_in_phar.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
";
+$file = (binary)"";
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/delete_in_phar_b.phpt b/ext/phar/tests/delete_in_phar_b.phpt
index d26f51cbf14..97ee4a12ae8 100755
--- a/ext/phar/tests/delete_in_phar_b.phpt
+++ b/ext/phar/tests/delete_in_phar_b.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
";
+$file = (binary)"";
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/delete_in_phar_confirm.phpt b/ext/phar/tests/delete_in_phar_confirm.phpt
index 13a8d0db298..360b79a8751 100644
--- a/ext/phar/tests/delete_in_phar_confirm.phpt
+++ b/ext/phar/tests/delete_in_phar_confirm.phpt
@@ -9,7 +9,7 @@ phar.require_hash=0
";
+$file = (binary)"";
$files = array();
$files['a.php'] = '';
diff --git a/ext/phar/tests/dir.phpt b/ext/phar/tests/dir.phpt
index a8f9d3f889b..716d5f78462 100644
--- a/ext/phar/tests/dir.phpt
+++ b/ext/phar/tests/dir.phpt
@@ -37,7 +37,7 @@ mkdir('phar://' . dirname(__FILE__) . '/ok.phar/fails');
file_put_contents('phar://' . dirname(__FILE__) . '/ok.phar/sub/directory.txt', 'hi');
mkdir('phar://' . dirname(__FILE__) . '/ok.phar/sub');
mkdir('phar://' . dirname(__FILE__) . '/ok.phar/sub/directory.txt');
-file_put_contents(dirname(__FILE__) . '/oops.phar', '
@@ -40,7 +39,9 @@ include $pname . '/foo/hi';
--EXPECTF--
-Warning: file_get_contents() expects parameter 1 to be string, array given in %sfgc_edgecases.php on line %d
+Notice: Array to string conversion in %sfgc_edgecases.php on line %d
+
+Warning: file_get_contents(Array): failed to open stream: No such file or directory in %sfgc_edgecases.php on line %d
blah
@@ -70,7 +70,6 @@ echo file_get_contents("foob", true);
echo file_get_contents("./hi", 0, $context);
echo file_get_contents("../oops");
echo file_get_contents("./hi", 0, $context, 50000);
-ini_set("magic_quotes_runtime", 1);
echo file_get_contents("./hi");
echo file_get_contents("./hi", 0, $context, 0, 0);
?>
@@ -79,17 +78,16 @@ Warning: file_get_contents(phar://%sfgc_edgecases.phar.php/oops): failed to open
Warning: file_get_contents(): Failed to seek to position 50000 in the stream in phar://%sfgc_edgecases.phar.php/foo/hi on line %d
===DONE===
\ No newline at end of file
diff --git a/ext/phar/tests/files/nophar.phar b/ext/phar/tests/files/nophar.phar
index f1c52520182..4eb3083c924 100644
Binary files a/ext/phar/tests/files/nophar.phar and b/ext/phar/tests/files/nophar.phar differ
diff --git a/ext/phar/tests/files/phar_oo_test.inc b/ext/phar/tests/files/phar_oo_test.inc
index 9863e8da937..e92b4444c15 100644
--- a/ext/phar/tests/files/phar_oo_test.inc
+++ b/ext/phar/tests/files/phar_oo_test.inc
@@ -4,7 +4,7 @@ ini_set('date.timezone', 'GMT');
$fname = dirname(__FILE__) . '/phar_oo_test.phar.php';
$pname = 'phar://' . $fname;
-$file = '';
+$file = (binary)'';
$files = array();
diff --git a/ext/phar/tests/files/phar_test.inc b/ext/phar/tests/files/phar_test.inc
index 0f989f9db11..f82471d13b4 100644
--- a/ext/phar/tests/files/phar_test.inc
+++ b/ext/phar/tests/files/phar_test.inc
@@ -4,7 +4,7 @@ if (function_exists('date_default_timezone_set')) {
date_default_timezone_set('UTC');
}
-$manifest = '';
+$manifest = (binary)'';
$glags = 0;
foreach($files as $name => $cont)
@@ -40,8 +40,8 @@ foreach($files as $name => $cont)
if (isset($meta)) $meta = serialize($meta);
// write manifest entry
- $manifest .= pack('V', strlen($name)) . $name;
- $manifest .= pack('VVVVVV', $ulen, $time, $clen, $crc32, $flags|$perm, strlen($meta)) . $meta;
+ $manifest .= pack('V', strlen($name)) . (binary)$name;
+ $manifest .= pack('VVVVVV', $ulen, $time, $clen, $crc32, $flags|$perm, strlen($meta)) . (binary)$meta;
// globals
$gflags |= $flags;
@@ -51,12 +51,14 @@ foreach($files as $name => $cont)
if (!isset($alias)) $alias = 'hio';
if (isset($pmeta)) $pmeta = serialize($pmeta); else $pmeta = '';
-$manifest = pack('VnVV', count($files), isset($hasdir) ? 0x1110 : 0x1000, $gflags, strlen($alias)) . $alias . pack('V', strlen($pmeta)) . $pmeta . $manifest;
+
+$manifest = pack('VnVV', count($files), isset($hasdir) ? 0x1110 : 0x1000, $gflags, strlen($alias)) . (binary)$alias . pack('V', strlen($pmeta)) . (binary)$pmeta . $manifest;
+$file = (binary)$file;
$file .= pack('V', strlen($manifest)) . $manifest;
foreach($files as $cont)
{
- $file .= $cont;
+ $file .= (binary)$cont;
}
file_put_contents($fname, $file);
diff --git a/ext/phar/tests/fopen_edgecases2.phpt b/ext/phar/tests/fopen_edgecases2.phpt
index 3579a2c2216..b8f33b40a38 100644
--- a/ext/phar/tests/fopen_edgecases2.phpt
+++ b/ext/phar/tests/fopen_edgecases2.phpt
@@ -35,7 +35,9 @@ include $pname . '/foo/hi';
--EXPECTF--
-Warning: fopen() expects parameter 1 to be string, array given in %sfopen_edgecases2.php on line %d
+Notice: Array to string conversion in %sfopen_edgecases2.php on line %d
+
+Warning: fopen(Array): failed to open stream: No such file or directory in %sfopen_edgecases2.php on line %d
blah
test
diff --git a/ext/phar/tests/frontcontroller10.phpt b/ext/phar/tests/frontcontroller10.phpt
index de6775fbfc2..667d5c243cd 100644
--- a/ext/phar/tests/frontcontroller10.phpt
+++ b/ext/phar/tests/frontcontroller10.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller rewrite access denied
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/hi
--FILE_EXTERNAL--
files/frontcontroller4.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
Status: 403 Access Denied
--EXPECT--
diff --git a/ext/phar/tests/frontcontroller11.phpt b/ext/phar/tests/frontcontroller11.phpt
index 51fffbe13ce..06ba4254979 100644
--- a/ext/phar/tests/frontcontroller11.phpt
+++ b/ext/phar/tests/frontcontroller11.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller mime type extension is not a string
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
--FILE_EXTERNAL--
files/frontcontroller5.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught exception 'PharException' with message 'Key of MIME type overrides array must be a file extension, was "0"' in %sfrontcontroller11.php:2
Stack trace:
diff --git a/ext/phar/tests/frontcontroller12.phpt b/ext/phar/tests/frontcontroller12.phpt
index 0c277b3a777..956ea1c050b 100644
--- a/ext/phar/tests/frontcontroller12.phpt
+++ b/ext/phar/tests/frontcontroller12.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller mime type unknown int
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
--FILE_EXTERNAL--
files/frontcontroller6.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller12.php:2
Stack trace:
diff --git a/ext/phar/tests/frontcontroller13.phpt b/ext/phar/tests/frontcontroller13.phpt
index 669857647d1..717e56996fa 100644
--- a/ext/phar/tests/frontcontroller13.phpt
+++ b/ext/phar/tests/frontcontroller13.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller mime type not string/int
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
--FILE_EXTERNAL--
files/frontcontroller7.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECTF--
Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller13.php:2
Stack trace:
diff --git a/ext/phar/tests/frontcontroller15.phpt b/ext/phar/tests/frontcontroller15.phpt
index daeb60954d0..370098014d1 100644
--- a/ext/phar/tests/frontcontroller15.phpt
+++ b/ext/phar/tests/frontcontroller15.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller mime type override, Phar::PHPS
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.php
--FILE_EXTERNAL--
files/frontcontroller8.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
<?php function hio(){}
diff --git a/ext/phar/tests/frontcontroller16.phpt b/ext/phar/tests/frontcontroller16.phpt
index cefb40dcfa7..712af40bf3e 100644
--- a/ext/phar/tests/frontcontroller16.phpt
+++ b/ext/phar/tests/frontcontroller16.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller mime type override, Phar::PHP
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.phps
--FILE_EXTERNAL--
files/frontcontroller8.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
hio1
diff --git a/ext/phar/tests/frontcontroller2.phpt b/ext/phar/tests/frontcontroller2.phpt
index 085fe1440e9..d0744dea1dc 100644
--- a/ext/phar/tests/frontcontroller2.phpt
+++ b/ext/phar/tests/frontcontroller2.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller PHP test
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/a.php
--FILE_EXTERNAL--
files/frontcontroller.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
hio
diff --git a/ext/phar/tests/frontcontroller21.phpt b/ext/phar/tests/frontcontroller21.phpt
index 8d91ccb1b22..d153520e56e 100644
--- a/ext/phar/tests/frontcontroller21.phpt
+++ b/ext/phar/tests/frontcontroller21.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller $_SERVER munging success
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -12,7 +12,7 @@ QUERY_STRING=test=hi
--FILE_EXTERNAL--
files/frontcontroller12.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECTF--
string(10) "/index.php"
string(10) "/index.php"
@@ -21,4 +21,4 @@ string(18) "/index.php?test=hi"
string(32) "/frontcontroller21.php/index.php"
string(22) "/frontcontroller21.php"
string(%d) "%sfrontcontroller21.php"
-string(40) "/frontcontroller21.php/index.php?test=hi"
\ No newline at end of file
+string(40) "/frontcontroller21.php/index.php?test=hi"
diff --git a/ext/phar/tests/frontcontroller22.phpt b/ext/phar/tests/frontcontroller22.phpt
index 5a96b979da2..c6b74832df7 100644
--- a/ext/phar/tests/frontcontroller22.phpt
+++ b/ext/phar/tests/frontcontroller22.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller include from cwd test 1
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,10 +11,10 @@ PATH_INFO=/index.php
--FILE_EXTERNAL--
files/frontcontroller13.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECTF--
-string(4) "test"
-string(12) "oof/test.php"
+unicode(4) "test"
+unicode(12) "oof/test.php"
Warning: include(./hi.php): failed to open stream: No such file or directory in phar://%s/oof/test.php on line %d
diff --git a/ext/phar/tests/frontcontroller23.phpt b/ext/phar/tests/frontcontroller23.phpt
index afc4ed164f6..441eb701c2c 100644
--- a/ext/phar/tests/frontcontroller23.phpt
+++ b/ext/phar/tests/frontcontroller23.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller with generic action router test
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/hi/there
--FILE_EXTERNAL--
files/frontcontroller14.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECTF--
string(9) "/hi/there"
-string(%d) "phar://%sfrontcontroller23.php/html/index.php"
\ No newline at end of file
+string(%d) "phar://%sfrontcontroller23.php/html/index.php"
diff --git a/ext/phar/tests/frontcontroller24.phpt b/ext/phar/tests/frontcontroller24.phpt
index da4c83ce674..5d94738ae7a 100644
--- a/ext/phar/tests/frontcontroller24.phpt
+++ b/ext/phar/tests/frontcontroller24.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller with custom 404 php script
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/unknown/file
--FILE_EXTERNAL--
files/frontcontroller8.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECTF--
-My 404 is rawesome
\ No newline at end of file
+My 404 is rawesome
diff --git a/ext/phar/tests/frontcontroller25.phpt b/ext/phar/tests/frontcontroller25.phpt
index 3bffc5d5c48..80a0844f2ec 100644
--- a/ext/phar/tests/frontcontroller25.phpt
+++ b/ext/phar/tests/frontcontroller25.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller with extra path_info
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a1.phps/extra/stuff
--FILE_EXTERNAL--
files/frontcontroller8.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECTF--
string(42) "/frontcontroller25.php/a1.phps/extra/stuff"
-string(12) "/extra/stuff"
\ No newline at end of file
+string(12) "/extra/stuff"
diff --git a/ext/phar/tests/frontcontroller26.phpt b/ext/phar/tests/frontcontroller26.phpt
index a8097b0886c..7d787ddf494 100644
--- a/ext/phar/tests/frontcontroller26.phpt
+++ b/ext/phar/tests/frontcontroller26.phpt
@@ -11,4 +11,4 @@ files/frontcontroller8.phar
--EXPECTHEADERS--
Content-type: application/octet-stream
--EXPECTF--
-
--ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/noext
--FILE_EXTERNAL--
files/frontcontroller8.phar
--EXPECTHEADERS--
-Content-type: text/plain
+Content-type: text/plain;charset=UTF-8
--EXPECTF--
-hi
\ No newline at end of file
+hi
diff --git a/ext/phar/tests/frontcontroller28.phpt b/ext/phar/tests/frontcontroller28.phpt
index a9c3df27d3e..577800885b1 100644
--- a/ext/phar/tests/frontcontroller28.phpt
+++ b/ext/phar/tests/frontcontroller28.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller with huge file
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/bigfile.txt
--FILE_EXTERNAL--
files/frontcontroller8.phar
--EXPECTHEADERS--
-Content-type: text/plain
+Content-type: text/plain;charset=UTF-8
--EXPECT--
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
diff --git a/ext/phar/tests/frontcontroller29.phpt b/ext/phar/tests/frontcontroller29.phpt
index 49b5a718ae2..2d0f5b5c058 100644
--- a/ext/phar/tests/frontcontroller29.phpt
+++ b/ext/phar/tests/frontcontroller29.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller with fatal error in php file
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,6 +11,6 @@ PATH_INFO=/fatalerror.phps
--FILE_EXTERNAL--
files/frontcontroller8.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECTF--
-Fatal error: Call to undefined function oopsie_daisy() in phar://%sfatalerror.phps on line 1
\ No newline at end of file
+Fatal error: Call to undefined function oopsie_daisy() in phar://%sfatalerror.phps on line 1
diff --git a/ext/phar/tests/frontcontroller3.phpt b/ext/phar/tests/frontcontroller3.phpt
index 98ec0e96f42..ac36485837b 100644
--- a/ext/phar/tests/frontcontroller3.phpt
+++ b/ext/phar/tests/frontcontroller3.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller phps
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -11,7 +11,7 @@ PATH_INFO=/a.phps
--FILE_EXTERNAL--
files/frontcontroller.phar
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--EXPECT--
<?php function hio(){}
diff --git a/ext/phar/tests/frontcontroller30.phpt b/ext/phar/tests/frontcontroller30.phpt
index de6960c2444..fd6088d05aa 100644
--- a/ext/phar/tests/frontcontroller30.phpt
+++ b/ext/phar/tests/frontcontroller30.phpt
@@ -9,4 +9,4 @@ REQUEST_URI=/huh?
files/frontcontroller8.phar
--EXPECTF--
oops did not run
-%a
\ No newline at end of file
+%a
diff --git a/ext/phar/tests/frontcontroller31.phpt b/ext/phar/tests/frontcontroller31.phpt
index b5d6835335c..a02c937b58d 100644
--- a/ext/phar/tests/frontcontroller31.phpt
+++ b/ext/phar/tests/frontcontroller31.phpt
@@ -1,15 +1,15 @@
--TEST--
Phar front controller with invalid callback for rewrites
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
SCRIPT_NAME=/frontcontroller31.php
REQUEST_URI=/frontcontroller31.php
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--FILE_EXTERNAL--
files/frontcontroller16.phar
--EXPECT--
-phar error: invalid rewrite callback
\ No newline at end of file
+phar error: invalid rewrite callback
diff --git a/ext/phar/tests/frontcontroller32.phpt b/ext/phar/tests/frontcontroller32.phpt
index 61d5c6aca40..3a43cc239a4 100644
--- a/ext/phar/tests/frontcontroller32.phpt
+++ b/ext/phar/tests/frontcontroller32.phpt
@@ -1,15 +1,15 @@
--TEST--
Phar front controller with valid callback that is not good
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
SCRIPT_NAME=/frontcontroller32.php
REQUEST_URI=/frontcontroller32.php
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--FILE_EXTERNAL--
files/frontcontroller17.phar
--EXPECTF--
-%ahar error: failed to call rewrite callback
\ No newline at end of file
+%ahar error: failed to call rewrite callback
diff --git a/ext/phar/tests/frontcontroller33.phpt b/ext/phar/tests/frontcontroller33.phpt
index d8750b99346..91581f43af8 100644
--- a/ext/phar/tests/frontcontroller33.phpt
+++ b/ext/phar/tests/frontcontroller33.phpt
@@ -1,15 +1,15 @@
--TEST--
Phar front controller with valid callback that does not return any value
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
SCRIPT_NAME=/frontcontroller33.php
REQUEST_URI=/frontcontroller33.php
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--FILE_EXTERNAL--
files/frontcontroller18.phar
--EXPECTF--
-phar error: rewrite callback must return a string or false
\ No newline at end of file
+phar error: rewrite callback must return a string or false
diff --git a/ext/phar/tests/frontcontroller34.phpt b/ext/phar/tests/frontcontroller34.phpt
index 4e0b0cd6614..34a49ded4df 100644
--- a/ext/phar/tests/frontcontroller34.phpt
+++ b/ext/phar/tests/frontcontroller34.phpt
@@ -1,7 +1,7 @@
--TEST--
Phar front controller with cwd
--INI--
-default_charset=
+default_charset=UTF-8
--SKIPIF--
--ENV--
@@ -9,7 +9,7 @@ SCRIPT_NAME=/frontcontroller34.php
REQUEST_URI=/frontcontroller34.php/start/index.php
PATH_INFO=/start/index.php
--EXPECTHEADERS--
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
--FILE_EXTERNAL--
files/frontcontroller19.phar
--EXPECT--
diff --git a/ext/phar/tests/frontcontroller6.phpt b/ext/phar/tests/frontcontroller6.phpt
index 1a2cc2cd23d..86af8a694cb 100644
--- a/ext/phar/tests/frontcontroller6.phpt
+++ b/ext/phar/tests/frontcontroller6.phpt
@@ -18,4 +18,4 @@ Status: 404 Not Found
404 - File /notfound.php Not Found
-
\ No newline at end of file
+