mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Sanitation and error handling for plugin install. Props DD32. see #6015
git-svn-id: https://develop.svn.wordpress.org/trunk@9163 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+14
-10
@@ -108,16 +108,19 @@ if ( !defined('WP_CONTENT_DIR') )
|
||||
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down
|
||||
|
||||
if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) {
|
||||
if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
|
||||
require_once( WP_CONTENT_DIR . '/maintenance.php' );
|
||||
die();
|
||||
}
|
||||
include(ABSPATH . '.maintenance');
|
||||
// If the $upgrading timestamp is older than 10 minutes, don't die.
|
||||
if ( ( time() - $upgrading ) < 600 ) {
|
||||
if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
|
||||
require_once( WP_CONTENT_DIR . '/maintenance.php' );
|
||||
die();
|
||||
}
|
||||
|
||||
$protocol = $_SERVER["SERVER_PROTOCOL"];
|
||||
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
|
||||
$protocol = 'HTTP/1.0';
|
||||
header( "$protocol 503 Service Unavailable", true, 503 );
|
||||
header( 'Content-Type: text/html; charset=utf-8' );
|
||||
$protocol = $_SERVER["SERVER_PROTOCOL"];
|
||||
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
|
||||
$protocol = 'HTTP/1.0';
|
||||
header( "$protocol 503 Service Unavailable", true, 503 );
|
||||
header( 'Content-Type: text/html; charset=utf-8' );
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
@@ -131,7 +134,8 @@ if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) {
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
die();
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
if ( !extension_loaded('mysql') && !file_exists(WP_CONTENT_DIR . '/db.php') )
|
||||
|
||||
Reference in New Issue
Block a user