Skip to content

Commit 7a7b2a0

Browse files
committed
Merge branch 'PHP-5.4'
2 parents e70aed5 + 07ea38b commit 7a7b2a0

File tree

3 files changed

+21
-33
lines changed

3 files changed

+21
-33
lines changed

sapi/cli/php_cli_server.c

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ static php_cli_server_http_reponse_status_code_pair status_map[] = {
245245
};
246246

247247
static php_cli_server_http_reponse_status_code_pair template_map[] = {
248-
{ 400, "<h1 class=\"h\">%s</h1><p>Your browser sent a request that this server could not understand.</p>" },
249-
{ 404, "<h1 class=\"h\">%s</h1><p>The requested resource %s was not found on this server.</p>" },
250-
{ 500, "<h1 class=\"h\">%s</h1><p>The server is temporarily unavailable.</p>" },
251-
{ 501, "<h1 class=\"h\">%s</h1><p>Request method not supported.</p>" }
248+
{ 400, "<h1>%s</h1><p>Your browser sent a request that this server could not understand.</p>" },
249+
{ 404, "<h1>%s</h1><p>The requested resource %s was not found on this server.</p>" },
250+
{ 500, "<h1>%s</h1><p>The server is temporarily unavailable.</p>" },
251+
{ 501, "<h1>%s</h1><p>Request method not supported.</p>" }
252252
};
253253

254254
static php_cli_server_ext_mime_type_pair mime_type_map[] = {
@@ -279,22 +279,10 @@ ZEND_DECLARE_MODULE_GLOBALS(cli_server);
279279
/* {{{ static char php_cli_server_css[]
280280
* copied from ext/standard/info.c
281281
*/
282-
static const char php_cli_server_css[] = "<style type=\"text/css\">\n" \
283-
"body {background-color: #ffffff; color: #000000;}\n" \
284-
"body, td, th, h1, h2 {font-family: sans-serif;}\n" \
285-
".center {text-align: center;}\n" \
286-
".center table { margin-left: auto; margin-right: auto; text-align: left;}\n" \
287-
".center th { text-align: center !important; }\n" \
288-
"h1 {font-size: 150%;}\n" \
289-
"h2 {font-size: 125%;}\n" \
290-
".p {text-align: left;}\n" \
291-
".e {background-color: #ccccff; font-weight: bold; color: #000000;}\n" \
292-
".h {background-color: #9999cc; font-weight: bold; color: #000000;}\n" \
293-
".v {background-color: #cccccc; color: #000000;}\n" \
294-
".vr {background-color: #cccccc; text-align: right; color: #000000;}\n" \
295-
"img {float: right; border: 0px;}\n" \
296-
"hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}\n" \
297-
"</style>\n";
282+
static const char php_cli_server_css[] = "<style>\n" \
283+
"body { background-color: #ffffff; color: #000000; }\n" \
284+
"h1 { font-family: sans-serif; font-size: 150%; background-color: #9999cc; font-weight: bold; color: #000000; margin-top: 0;}\n" \
285+
"</style>\n";
298286
/* }}} */
299287

300288
static void char_ptr_dtor_p(char **p) /* {{{ */
@@ -1757,7 +1745,7 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server
17571745
escaped_request_uri = php_escape_html_entities_ex((unsigned char *)client->request.request_uri, client->request.request_uri_len, &escaped_request_uri_len, 0, ENT_QUOTES, NULL, 0 TSRMLS_CC);
17581746

17591747
{
1760-
static const char prologue_template[] = "<html><head><title>%d %s</title>";
1748+
static const char prologue_template[] = "<!doctype html><html><head><title>%d %s</title>";
17611749
php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(strlen(prologue_template) + 3 + strlen(status_string) + 1);
17621750
if (!chunk) {
17631751
goto fail;

sapi/cli/tests/php_cli_server_013.phpt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ HEADER
3333
}
3434
}
3535

36-
echo preg_replace("/<style type=\"text\/css\">(.*?)<\/style>/s", "<style type=\"text/css\">AAA</style>", $output), "\n";
36+
echo preg_replace("/<style>(.*?)<\/style>/s", "<style>AAA</style>", $output), "\n";
3737
fclose($fp);
3838

3939

@@ -55,7 +55,7 @@ HEADER
5555
}
5656
}
5757

58-
echo preg_replace("/<style type=\"text\/css\">(.*?)<\/style>/s", "<style type=\"text/css\">AAA</style>", $output), "\n";
58+
echo preg_replace("/<style>(.*?)<\/style>/s", "<style>AAA</style>", $output), "\n";
5959
fclose($fp);
6060

6161
$output = '';
@@ -76,7 +76,7 @@ HEADER
7676
}
7777
}
7878

79-
echo preg_replace("/<style type=\"text\/css\">(.*?)<\/style>/s", "<style type=\"text/css\">AAA</style>", $output), "\n";
79+
echo preg_replace("/<style>(.*?)<\/style>/s", "<style>AAA</style>", $output), "\n";
8080
fclose($fp);
8181
?>
8282
--EXPECTF--
@@ -87,22 +87,22 @@ Connection: close
8787
Content-Type: text/html; charset=UTF-8
8888
Content-Length: %d
8989

90-
<html><head><title>404 Not Found</title><style type="text/css">AAA</style>
91-
</head><body><h1 class="h">Not Found</h1><p>The requested resource / was not found on this server.</p></body></html>
90+
<!doctype html><html><head><title>404 Not Found</title><style>AAA</style>
91+
</head><body><h1>Not Found</h1><p>The requested resource / was not found on this server.</p></body></html>
9292
HTTP/1.1 404 Not Found
9393
Host: %s
9494
Connection: close
9595
Content-Type: text/html; charset=UTF-8
9696
Content-Length: %d
9797

98-
<html><head><title>404 Not Found</title><style type="text/css">AAA</style>
99-
</head><body><h1 class="h">Not Found</h1><p>The requested resource /main/style.css was not found on this server.</p></body></html>
98+
<!doctype html><html><head><title>404 Not Found</title><style>AAA</style>
99+
</head><body><h1>Not Found</h1><p>The requested resource /main/style.css was not found on this server.</p></body></html>
100100
HTTP/1.1 404 Not Found
101101
Host: %s
102102
Connection: close
103103
Content-Type: text/html; charset=UTF-8
104104
Content-Length: %d
105105

106-
<html><head><title>404 Not Found</title><style type="text/css">AAA</style>
107-
</head><body><h1 class="h">Not Found</h1><p>The requested resource /main/foo/bar was not found on this server.</p></body></html>
106+
<!doctype html><html><head><title>404 Not Found</title><style>AAA</style>
107+
</head><body><h1>Not Found</h1><p>The requested resource /main/foo/bar was not found on this server.</p></body></html>
108108

sapi/cli/tests/php_cli_server_014.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ HEADER
5757
}
5858
}
5959

60-
echo preg_replace("/<style type=\"text\/css\">(.*?)<\/style>/s", "<style type=\"text/css\">AAA</style>", $output), "\n";
60+
echo preg_replace("/<style>(.*?)<\/style>/s", "<style>AAA</style>", $output), "\n";
6161
fclose($fp);
6262

6363
?>
@@ -76,5 +76,5 @@ Connection: close
7676
Content-Type: %s
7777
Content-Length: %d
7878

79-
<html><head><title>404 Not Found</title><style type="text/css">AAA</style>
80-
</head><body><h1 class="h">Not Found</h1><p>The requested resource /main/no-exists.php was not found on this server.</p></body></html>
79+
<!doctype html><html><head><title>404 Not Found</title><style>AAA</style>
80+
</head><body><h1>Not Found</h1><p>The requested resource /main/no-exists.php was not found on this server.</p></body></html>

0 commit comments

Comments
 (0)