|
|
b74969 |
From 73ca9b37731dd9690ffd9706333b17eaf90ea091 Mon Sep 17 00:00:00 2001
|
|
|
b74969 |
From: Stanislav Malyshev <stas@php.net>
|
|
|
b74969 |
Date: Sun, 2 Jul 2017 13:29:37 -0700
|
|
|
b74969 |
Subject: [PATCH] Fix bug #74782: remove file name from output to avoid XSS
|
|
|
b74969 |
|
|
|
b74969 |
---
|
|
|
b74969 |
ext/phar/shortarc.php | 2 +-
|
|
|
b74969 |
ext/phar/stub.h | 4 ++--
|
|
|
b74969 |
ext/phar/tests/cache_list/copyonwrite11.phar.phpt | 2 +-
|
|
|
b74969 |
ext/phar/tests/phar_commitwrite.phpt | 2 +-
|
|
|
b74969 |
ext/phar/tests/phar_convert_repeated.phpt | 2 +-
|
|
|
b74969 |
ext/phar/tests/phar_create_in_cwd.phpt | 2 +-
|
|
|
b74969 |
ext/phar/tests/phar_createdefaultstub.phpt | 22 +++++++++++-----------
|
|
|
b74969 |
ext/phar/tests/phar_offset_check.phpt | 4 ++--
|
|
|
b74969 |
ext/phar/tests/phar_setdefaultstub.phpt | 20 ++++++++++----------
|
|
|
b74969 |
ext/phar/tests/tar/phar_convert_phar.phpt | 6 +++---
|
|
|
b74969 |
ext/phar/tests/tar/phar_convert_phar2.phpt | 6 +++---
|
|
|
b74969 |
ext/phar/tests/tar/phar_convert_phar3.phpt | 6 +++---
|
|
|
b74969 |
ext/phar/tests/tar/phar_convert_phar4.phpt | 6 +++---
|
|
|
b74969 |
ext/phar/tests/zip/phar_convert_phar.phpt | 6 +++---
|
|
|
b74969 |
14 files changed, 45 insertions(+), 45 deletions(-)
|
|
|
b74969 |
|
|
|
b74969 |
diff --git a/ext/phar/shortarc.php b/ext/phar/shortarc.php
|
|
|
b74969 |
index 1bf3baa..e5ac8ba 100644
|
|
|
b74969 |
--- a/ext/phar/shortarc.php
|
|
|
b74969 |
+++ b/ext/phar/shortarc.php
|
|
|
b74969 |
@@ -74,7 +74,7 @@ if (@(isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && ($_
|
|
|
b74969 |
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
|
|
b74969 |
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
|
|
b74969 |
header('HTTP/1.0 404 Not Found');
|
|
|
b74969 |
- echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File ", $pt, " Not Found\n </body>\n</html>";
|
|
|
b74969 |
+ echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File Not Found\n </body>\n</html>";
|
|
|
b74969 |
exit;
|
|
|
b74969 |
}
|
|
|
b74969 |
$b = pathinfo($a);
|
|
|
b74969 |
diff --git a/ext/phar/stub.h b/ext/phar/stub.h
|
|
|
b74969 |
index 2825142..1edbb06 100644
|
|
|
b74969 |
--- a/ext/phar/stub.h
|
|
|
b74969 |
+++ b/ext/phar/stub.h
|
|
|
b74969 |
@@ -22,13 +22,13 @@ static inline void phar_get_stub(const char *index_php, const char *web, size_t
|
|
|
b74969 |
{
|
|
|
b74969 |
static const char newstub0[] = "
|
|
|
b74969 |
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(";
|
|
|
b74969 |
- static const char newstub1_1[] = "Extract_Phar::$temp)) {\nheader('HTTP/1.0 404 Not Found');\necho \"<html>\\n <head>\\n <title>File Not Found<title>\\n </head>\\n <body>\\n 404 - File \", $pt, \" Not Found\\n </body>\\n</html>\";\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 = '";
|
|
|
b74969 |
+ static const char newstub1_1[] = "Extract_Phar::$temp)) {\nheader('HTTP/1.0 404 Not Found');\necho \"<html>\\n <head>\\n <title>File Not Found<title>\\n </head>\\n <body>\\n 404 - File Not Found\\n </body>\\n</html>\";\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 = '";
|
|
|
b74969 |
static const char newstub2[] = "';\nconst LEN = ";
|
|
|
b74969 |
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";
|
|
|
b74969 |
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";
|
|
|
b74969 |
static const char newstub3_2[] = "ER(); ?>";
|
|
|
b74969 |
|
|
|
b74969 |
- static const int newstub_len = 6665;
|
|
|
b74969 |
+ static const int newstub_len = 6655;
|
|
|
b74969 |
|
|
|
b74969 |
*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);
|
|
|
b74969 |
}
|
|
|
b74969 |
diff --git a/ext/phar/tests/cache_list/copyonwrite11.phar.phpt b/ext/phar/tests/cache_list/copyonwrite11.phar.phpt
|
|
|
b74969 |
index 6538816..c3489e4 100644
|
|
|
b74969 |
--- a/ext/phar/tests/cache_list/copyonwrite11.phar.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/cache_list/copyonwrite11.phar.phpt
|
|
|
b74969 |
@@ -18,5 +18,5 @@ echo strlen($p2->getStub()),"\n";
|
|
|
b74969 |
echo "ok\n";
|
|
|
b74969 |
__HALT_COMPILER(); ?>
|
|
|
b74969 |
"
|
|
|
b74969 |
-6685
|
|
|
b74969 |
+6675
|
|
|
b74969 |
ok
|
|
|
b74969 |
\ No newline at end of file
|
|
|
b74969 |
diff --git a/ext/phar/tests/phar_commitwrite.phpt b/ext/phar/tests/phar_commitwrite.phpt
|
|
|
b74969 |
index 36d473e..00343ca 100644
|
|
|
b74969 |
--- a/ext/phar/tests/phar_commitwrite.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/phar_commitwrite.phpt
|
|
|
b74969 |
@@ -29,7 +29,7 @@ unlink(dirname(__FILE__) . '/brandnewphar.phar');
|
|
|
b74969 |
__HALT_COMPILER();
|
|
|
b74969 |
?>
|
|
|
b74969 |
--EXPECT--
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
string(200) "
|
|
|
b74969 |
function __autoload($class)
|
|
|
b74969 |
{
|
|
|
b74969 |
diff --git a/ext/phar/tests/phar_convert_repeated.phpt b/ext/phar/tests/phar_convert_repeated.phpt
|
|
|
b74969 |
index e4b1fe4..7880bf4 100644
|
|
|
b74969 |
--- a/ext/phar/tests/phar_convert_repeated.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/phar_convert_repeated.phpt
|
|
|
b74969 |
@@ -123,7 +123,7 @@ NULL
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
bool(false)
|
|
|
b74969 |
bool(false)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
NULL
|
|
|
b74969 |
================= convertToZip() =====================
|
|
|
b74969 |
bool(false)
|
|
|
b74969 |
diff --git a/ext/phar/tests/phar_create_in_cwd.phpt b/ext/phar/tests/phar_create_in_cwd.phpt
|
|
|
b74969 |
index 4b0e659..57b2432 100644
|
|
|
b74969 |
--- a/ext/phar/tests/phar_create_in_cwd.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/phar_create_in_cwd.phpt
|
|
|
b74969 |
@@ -32,7 +32,7 @@ __HALT_COMPILER();
|
|
|
b74969 |
unlink(dirname(__FILE__) . '/brandnewphar.phar');
|
|
|
b74969 |
?>
|
|
|
b74969 |
--EXPECT--
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
string(200) "
|
|
|
b74969 |
function __autoload($class)
|
|
|
b74969 |
{
|
|
|
b74969 |
diff --git a/ext/phar/tests/phar_createdefaultstub.phpt b/ext/phar/tests/phar_createdefaultstub.phpt
|
|
|
b74969 |
index abc9ad8..f2ee297 100644
|
|
|
b74969 |
--- a/ext/phar/tests/phar_createdefaultstub.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/phar_createdefaultstub.phpt
|
|
|
b74969 |
@@ -34,7 +34,7 @@ echo $e->getMessage() . "\n";
|
|
|
b74969 |
?>
|
|
|
b74969 |
===DONE===
|
|
|
b74969 |
--EXPECT--
|
|
|
b74969 |
-string(6683) "
|
|
|
b74969 |
+string(6673) "
|
|
|
b74969 |
|
|
|
b74969 |
$web = 'index.php';
|
|
|
b74969 |
|
|
|
b74969 |
@@ -110,7 +110,7 @@ exit;
|
|
|
b74969 |
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
|
|
b74969 |
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
|
|
b74969 |
header('HTTP/1.0 404 Not Found');
|
|
|
b74969 |
-echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File ", $pt, " Not Found\n </body>\n</html>";
|
|
|
b74969 |
+echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File Not Found\n </body>\n</html>";
|
|
|
b74969 |
exit;
|
|
|
b74969 |
}
|
|
|
b74969 |
$b = pathinfo($a);
|
|
|
b74969 |
@@ -144,7 +144,7 @@ const GZ = 0x1000;
|
|
|
b74969 |
const BZ2 = 0x2000;
|
|
|
b74969 |
const MASK = 0x3000;
|
|
|
b74969 |
const START = 'index.php';
|
|
|
b74969 |
-const LEN = 6685;
|
|
|
b74969 |
+const LEN = 6675;
|
|
|
b74969 |
|
|
|
b74969 |
static function go($return = false)
|
|
|
b74969 |
{
|
|
|
b74969 |
@@ -328,7 +328,7 @@ Extract_Phar::go();
|
|
|
b74969 |
__HALT_COMPILER(); ?>"
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
-string(6694) "
|
|
|
b74969 |
+string(6684) "
|
|
|
b74969 |
|
|
|
b74969 |
$web = 'index.php';
|
|
|
b74969 |
|
|
|
b74969 |
@@ -404,7 +404,7 @@ exit;
|
|
|
b74969 |
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
|
|
b74969 |
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
|
|
b74969 |
header('HTTP/1.0 404 Not Found');
|
|
|
b74969 |
-echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File ", $pt, " Not Found\n </body>\n</html>";
|
|
|
b74969 |
+echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File Not Found\n </body>\n</html>";
|
|
|
b74969 |
exit;
|
|
|
b74969 |
}
|
|
|
b74969 |
$b = pathinfo($a);
|
|
|
b74969 |
@@ -438,7 +438,7 @@ const GZ = 0x1000;
|
|
|
b74969 |
const BZ2 = 0x2000;
|
|
|
b74969 |
const MASK = 0x3000;
|
|
|
b74969 |
const START = 'my/custom/thingy.php';
|
|
|
b74969 |
-const LEN = 6696;
|
|
|
b74969 |
+const LEN = 6686;
|
|
|
b74969 |
|
|
|
b74969 |
static function go($return = false)
|
|
|
b74969 |
{
|
|
|
b74969 |
@@ -622,7 +622,7 @@ Extract_Phar::go();
|
|
|
b74969 |
__HALT_COMPILER(); ?>"
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
-int(7074)
|
|
|
b74969 |
+int(7064)
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
|
|
|
b74969 |
@@ -630,7 +630,7 @@ Illegal filename passed in for stub creation, was 401 characters long, and only
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
-string(6696) "
|
|
|
b74969 |
+string(6686) "
|
|
|
b74969 |
|
|
|
b74969 |
$web = 'the/web.php';
|
|
|
b74969 |
|
|
|
b74969 |
@@ -706,7 +706,7 @@ exit;
|
|
|
b74969 |
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
|
|
b74969 |
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
|
|
b74969 |
header('HTTP/1.0 404 Not Found');
|
|
|
b74969 |
-echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File ", $pt, " Not Found\n </body>\n</html>";
|
|
|
b74969 |
+echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File Not Found\n </body>\n</html>";
|
|
|
b74969 |
exit;
|
|
|
b74969 |
}
|
|
|
b74969 |
$b = pathinfo($a);
|
|
|
b74969 |
@@ -740,7 +740,7 @@ const GZ = 0x1000;
|
|
|
b74969 |
const BZ2 = 0x2000;
|
|
|
b74969 |
const MASK = 0x3000;
|
|
|
b74969 |
const START = 'my/custom/thingy.php';
|
|
|
b74969 |
-const LEN = 6698;
|
|
|
b74969 |
+const LEN = 6688;
|
|
|
b74969 |
|
|
|
b74969 |
static function go($return = false)
|
|
|
b74969 |
{
|
|
|
b74969 |
@@ -924,6 +924,6 @@ Extract_Phar::go();
|
|
|
b74969 |
__HALT_COMPILER(); ?>"
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
-int(7074)
|
|
|
b74969 |
+int(7064)
|
|
|
b74969 |
Illegal web filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
|
|
|
b74969 |
===DONE===
|
|
|
b74969 |
diff --git a/ext/phar/tests/phar_offset_check.phpt b/ext/phar/tests/phar_offset_check.phpt
|
|
|
b74969 |
index fe12534..303fed1 100644
|
|
|
b74969 |
--- a/ext/phar/tests/phar_offset_check.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/phar_offset_check.phpt
|
|
|
b74969 |
@@ -70,8 +70,8 @@ var_dump($phar->getAlias());
|
|
|
b74969 |
Entry .phar/stub.php does not exist
|
|
|
b74969 |
Entry .phar/alias.txt does not exist
|
|
|
b74969 |
Cannot set stub ".phar/stub.php" directly in phar "%sphar_offset_check.phar.php", use setStub
|
|
|
b74969 |
-int(6685)
|
|
|
b74969 |
-int(6685)
|
|
|
b74969 |
+int(6675)
|
|
|
b74969 |
+int(6675)
|
|
|
b74969 |
Cannot set alias ".phar/alias.txt" directly in phar "%sphar_offset_check.phar.php", use setAlias
|
|
|
b74969 |
string(5) "susan"
|
|
|
b74969 |
string(5) "susan"
|
|
|
b74969 |
diff --git a/ext/phar/tests/phar_setdefaultstub.phpt b/ext/phar/tests/phar_setdefaultstub.phpt
|
|
|
b74969 |
index 434e647..c8d12e9 100644
|
|
|
b74969 |
--- a/ext/phar/tests/phar_setdefaultstub.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/phar_setdefaultstub.phpt
|
|
|
b74969 |
@@ -54,7 +54,7 @@ try {
|
|
|
b74969 |
unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');
|
|
|
b74969 |
?>
|
|
|
b74969 |
--EXPECT--
|
|
|
b74969 |
-string(6685) "
|
|
|
b74969 |
+string(6675) "
|
|
|
b74969 |
|
|
|
b74969 |
$web = 'index.php';
|
|
|
b74969 |
|
|
|
b74969 |
@@ -130,7 +130,7 @@ exit;
|
|
|
b74969 |
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
|
|
b74969 |
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
|
|
b74969 |
header('HTTP/1.0 404 Not Found');
|
|
|
b74969 |
-echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File ", $pt, " Not Found\n </body>\n</html>";
|
|
|
b74969 |
+echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File Not Found\n </body>\n</html>";
|
|
|
b74969 |
exit;
|
|
|
b74969 |
}
|
|
|
b74969 |
$b = pathinfo($a);
|
|
|
b74969 |
@@ -164,7 +164,7 @@ const GZ = 0x1000;
|
|
|
b74969 |
const BZ2 = 0x2000;
|
|
|
b74969 |
const MASK = 0x3000;
|
|
|
b74969 |
const START = 'index.php';
|
|
|
b74969 |
-const LEN = 6685;
|
|
|
b74969 |
+const LEN = 6675;
|
|
|
b74969 |
|
|
|
b74969 |
static function go($return = false)
|
|
|
b74969 |
{
|
|
|
b74969 |
@@ -349,7 +349,7 @@ __HALT_COMPILER(); ?>
|
|
|
b74969 |
"
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
-string(6696) "
|
|
|
b74969 |
+string(6686) "
|
|
|
b74969 |
|
|
|
b74969 |
$web = 'index.php';
|
|
|
b74969 |
|
|
|
b74969 |
@@ -425,7 +425,7 @@ exit;
|
|
|
b74969 |
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
|
|
b74969 |
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
|
|
b74969 |
header('HTTP/1.0 404 Not Found');
|
|
|
b74969 |
-echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File ", $pt, " Not Found\n </body>\n</html>";
|
|
|
b74969 |
+echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File Not Found\n </body>\n</html>";
|
|
|
b74969 |
exit;
|
|
|
b74969 |
}
|
|
|
b74969 |
$b = pathinfo($a);
|
|
|
b74969 |
@@ -459,7 +459,7 @@ const GZ = 0x1000;
|
|
|
b74969 |
const BZ2 = 0x2000;
|
|
|
b74969 |
const MASK = 0x3000;
|
|
|
b74969 |
const START = 'my/custom/thingy.php';
|
|
|
b74969 |
-const LEN = 6696;
|
|
|
b74969 |
+const LEN = 6686;
|
|
|
b74969 |
|
|
|
b74969 |
static function go($return = false)
|
|
|
b74969 |
{
|
|
|
b74969 |
@@ -644,7 +644,7 @@ __HALT_COMPILER(); ?>
|
|
|
b74969 |
"
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
-string(6698) "
|
|
|
b74969 |
+string(6688) "
|
|
|
b74969 |
|
|
|
b74969 |
$web = 'the/web.php';
|
|
|
b74969 |
|
|
|
b74969 |
@@ -720,7 +720,7 @@ exit;
|
|
|
b74969 |
$a = realpath(Extract_Phar::$temp . DIRECTORY_SEPARATOR . $pt);
|
|
|
b74969 |
if (!$a || strlen(dirname($a)) < strlen(Extract_Phar::$temp)) {
|
|
|
b74969 |
header('HTTP/1.0 404 Not Found');
|
|
|
b74969 |
-echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File ", $pt, " Not Found\n </body>\n</html>";
|
|
|
b74969 |
+echo "<html>\n <head>\n <title>File Not Found<title>\n </head>\n <body>\n 404 - File Not Found\n </body>\n</html>";
|
|
|
b74969 |
exit;
|
|
|
b74969 |
}
|
|
|
b74969 |
$b = pathinfo($a);
|
|
|
b74969 |
@@ -754,7 +754,7 @@ const GZ = 0x1000;
|
|
|
b74969 |
const BZ2 = 0x2000;
|
|
|
b74969 |
const MASK = 0x3000;
|
|
|
b74969 |
const START = 'my/custom/thingy.php';
|
|
|
b74969 |
-const LEN = 6698;
|
|
|
b74969 |
+const LEN = 6688;
|
|
|
b74969 |
|
|
|
b74969 |
static function go($return = false)
|
|
|
b74969 |
{
|
|
|
b74969 |
@@ -939,6 +939,6 @@ __HALT_COMPILER(); ?>
|
|
|
b74969 |
"
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
============================================================================
|
|
|
b74969 |
-int(7076)
|
|
|
b74969 |
+int(7066)
|
|
|
b74969 |
Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed
|
|
|
b74969 |
===DONE===
|
|
|
b74969 |
diff --git a/ext/phar/tests/tar/phar_convert_phar.phpt b/ext/phar/tests/tar/phar_convert_phar.phpt
|
|
|
b74969 |
index d754ac1..b700f4a 100644
|
|
|
b74969 |
--- a/ext/phar/tests/tar/phar_convert_phar.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/tar/phar_convert_phar.phpt
|
|
|
b74969 |
@@ -47,12 +47,12 @@ __HALT_COMPILER();
|
|
|
b74969 |
?>
|
|
|
b74969 |
--EXPECT--
|
|
|
b74969 |
bool(false)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
string(60) "
|
|
|
b74969 |
__HALT_COMPILER();"
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
===DONE===
|
|
|
b74969 |
diff --git a/ext/phar/tests/tar/phar_convert_phar2.phpt b/ext/phar/tests/tar/phar_convert_phar2.phpt
|
|
|
b74969 |
index 58901ca..c3a38bd 100644
|
|
|
b74969 |
--- a/ext/phar/tests/tar/phar_convert_phar2.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/tar/phar_convert_phar2.phpt
|
|
|
b74969 |
@@ -49,14 +49,14 @@ __HALT_COMPILER();
|
|
|
b74969 |
?>
|
|
|
b74969 |
--EXPECT--
|
|
|
b74969 |
bool(false)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
string(60) "
|
|
|
b74969 |
__HALT_COMPILER();"
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
int(4096)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
===DONE===
|
|
|
b74969 |
diff --git a/ext/phar/tests/tar/phar_convert_phar3.phpt b/ext/phar/tests/tar/phar_convert_phar3.phpt
|
|
|
b74969 |
index 543c89b..b6f7a160 100644
|
|
|
b74969 |
--- a/ext/phar/tests/tar/phar_convert_phar3.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/tar/phar_convert_phar3.phpt
|
|
|
b74969 |
@@ -49,14 +49,14 @@ __HALT_COMPILER();
|
|
|
b74969 |
?>
|
|
|
b74969 |
--EXPECT--
|
|
|
b74969 |
bool(false)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
string(60) "
|
|
|
b74969 |
__HALT_COMPILER();"
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
int(8192)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
===DONE===
|
|
|
b74969 |
diff --git a/ext/phar/tests/tar/phar_convert_phar4.phpt b/ext/phar/tests/tar/phar_convert_phar4.phpt
|
|
|
b74969 |
index 9b095f1..3fcfd6c 100644
|
|
|
b74969 |
--- a/ext/phar/tests/tar/phar_convert_phar4.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/tar/phar_convert_phar4.phpt
|
|
|
b74969 |
@@ -54,7 +54,7 @@ __HALT_COMPILER();
|
|
|
b74969 |
?>
|
|
|
b74969 |
--EXPECT--
|
|
|
b74969 |
bool(false)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
string(2) "hi"
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
string(60) "
|
|
|
b74969 |
@@ -62,10 +62,10 @@ __HALT_COMPILER();"
|
|
|
b74969 |
string(2) "hi"
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
int(4096)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
string(2) "hi"
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
string(2) "hi"
|
|
|
b74969 |
===DONE===
|
|
|
b74969 |
diff --git a/ext/phar/tests/zip/phar_convert_phar.phpt b/ext/phar/tests/zip/phar_convert_phar.phpt
|
|
|
b74969 |
index cad6d9f..f3c6b73 100644
|
|
|
b74969 |
--- a/ext/phar/tests/zip/phar_convert_phar.phpt
|
|
|
b74969 |
+++ b/ext/phar/tests/zip/phar_convert_phar.phpt
|
|
|
b74969 |
@@ -46,12 +46,12 @@ __HALT_COMPILER();
|
|
|
b74969 |
?>
|
|
|
b74969 |
--EXPECT--
|
|
|
b74969 |
bool(false)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
string(60) "
|
|
|
b74969 |
__HALT_COMPILER();"
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
bool(true)
|
|
|
b74969 |
-int(6683)
|
|
|
b74969 |
+int(6673)
|
|
|
b74969 |
===DONE===
|
|
|
b74969 |
--
|
|
|
b74969 |
2.1.4
|
|
|
b74969 |
|