Skip to content

Commit 785e66a

Browse files
committed
PR #260: Update css for 404 pages to feel more up to date and have a consistent layout across browsers
1 parent 97157b3 commit 785e66a

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

sapi/cli/php_cli_server.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static php_cli_server_http_reponse_status_code_pair status_map[] = {
246246

247247
static php_cli_server_http_reponse_status_code_pair template_map[] = {
248248
{ 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>" },
249+
{ 404, "<h1>%s</h1><p>The requested resource <code class=\"url\">%s</code> was not found on this server.</p>" },
250250
{ 500, "<h1>%s</h1><p>The server is temporarily unavailable.</p>" },
251251
{ 501, "<h1>%s</h1><p>Request method not supported.</p>" }
252252
};
@@ -283,8 +283,10 @@ ZEND_DECLARE_MODULE_GLOBALS(cli_server);
283283
* copied from ext/standard/info.c
284284
*/
285285
static const char php_cli_server_css[] = "<style>\n" \
286-
"body { background-color: #ffffff; color: #000000; }\n" \
287-
"h1 { font-family: sans-serif; font-size: 150%; background-color: #9999cc; font-weight: bold; color: #000000; margin-top: 0;}\n" \
286+
"body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; }\n" \
287+
"h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em; line-height:2em; border-bottom: 1px inset black; margin: 0; }\n" \
288+
"h1, p { padding-left: 10px; }\n" \
289+
"code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;}\n" \
288290
"</style>\n";
289291
/* }}} */
290292

sapi/cli/tests/php_cli_server_013.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,21 @@ Content-Type: text/html; charset=UTF-8
8888
Content-Length: %d
8989

9090
<!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>
91+
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/</code> 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

9898
<!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>
99+
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/main/style.css</code> 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

106106
<!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>
107+
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/main/foo/bar</code> was not found on this server.</p></body></html>
108108

sapi/cli/tests/php_cli_server_014.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ Content-Type: %s
7777
Content-Length: %d
7878

7979
<!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>
80+
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/main/no-exists.php</code> was not found on this server.</p></body></html>

0 commit comments

Comments
 (0)