Commit 9315a45e authored by alexpott's avatar alexpott

Issue #2338759 by StryKaizer, tom_ek | alexpott: Fixed core/update.php is now just update.php.

parent 74857b53
......@@ -129,7 +129,7 @@ DirectoryIndex index.php index.html index.htm
# Note: The following URI conditions are not anchored at the start (^),
# because Drupal may be located in a subdirectory. To further improve
# security, you can replace '!/' with '!^/'.
# Allow access to PHP files in /core (like update.php or install.php):
# Allow access to PHP files in /core (like authorize.php or install.php):
RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
# Allow access to test-specific PHP files:
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?.php$
......
......@@ -95,7 +95,7 @@ following the instructions in the INTRODUCTION section at the top of this file:
5. Re-apply any modifications to files such as .htaccess or robots.txt.
6. Run update.php by visiting http://www.example.com/core/update.php (replace
6. Run update.php by visiting http://www.example.com/update.php (replace
www.example.com with your domain name). This will update the core database
tables.
......
......@@ -818,8 +818,8 @@ protected function initializeRequestGlobals(Request $request) {
// For a request URI of '/index.php/foo', $_SERVER['SCRIPT_NAME'] is
// '/index.php', whereas $_SERVER['PHP_SELF'] is '/index.php/foo'.
if ($dir = rtrim(dirname($request->server->get('SCRIPT_NAME')), '\/')) {
// Remove "core" directory if present, allowing install.php, update.php,
// and others to auto-detect a base path.
// Remove "core" directory if present, allowing install.php,
// authorize.php, and others to auto-detect a base path.
$core_position = strrpos($dir, '/core');
if ($core_position !== FALSE && strlen($dir) - 5 == $core_position) {
$base_path = substr($dir, 0, $core_position);
......@@ -855,7 +855,7 @@ protected function initializeRequestGlobals(Request $request) {
if (strpos(request_uri(TRUE) . '/', $base_path . $script_path) !== 0) {
$script_path = '';
}
// @todo Temporary BC for install.php, update.php, and other scripts.
// @todo Temporary BC for install.php, authorize.php, and other scripts.
// - http://drupal.org/node/1547184
// - http://drupal.org/node/1546082
if ($script_path !== 'index.php/') {
......@@ -891,7 +891,7 @@ protected function initializeCookieGlobals(Request $request) {
// to use the same session identifiers across HTTP and HTTPS.
$session_name = $request->getHost() . $request->getBasePath();
// Replace "core" out of session_name so core scripts redirect properly,
// specifically install.php and update.php.
// specifically install.php.
$session_name = preg_replace('/\/core$/', '', $session_name);
// HTTP_HOST can be modified by a visitor, but has been sanitized already
// in DrupalKernel::bootEnvironment().
......
......@@ -26,10 +26,11 @@ public function __construct(TranslationInterface $string_translation) {
$title = $this->t('Drupal already installed');
$message = $this->t('<ul>
<li>To start over, you must empty your existing database and copy <em>default.settings.php</em> over <em>settings.php</em>.</li>
<li>To upgrade an existing installation, proceed to the <a href="!base-url/core/update.php">update script</a>.</li>
<li>To upgrade an existing installation, proceed to the <a href="!update-url">update script</a>.</li>
<li>View your <a href="!base-url">existing site</a>.</li>
</ul>', array(
'!base-url' => $GLOBALS['base_url'],
'!update-url' => $GLOBALS['base_path'] . 'update.php',
));
parent::__construct($message, $title);
}
......
......@@ -448,7 +448,7 @@ function system_requirements($phase) {
if (max($updates) > $default) {
$requirements['update']['severity'] = REQUIREMENT_ERROR;
$requirements['update']['value'] = t('Out of date');
$requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => base_path() . 'core/update.php'));
$requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => \Drupal::url('system.db_update')));
break;
}
}
......@@ -456,7 +456,7 @@ function system_requirements($phase) {
if (!isset($requirements['update']['severity']) && \Drupal::service('entity.definition_update_manager')->needsUpdates()) {
$requirements['update']['severity'] = REQUIREMENT_ERROR;
$requirements['update']['value'] = t('Out of date');
$requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => base_path() . 'update.php'));
$requirements['update']['description'] = t('Some modules have database schema updates to install. You should run the <a href="@update">database update script</a> immediately.', array('@update' => \Drupal::url('system.db_update')));
}
}
......
......@@ -113,14 +113,14 @@ function system_help($route_name, RouteMatchInterface $route_match) {
$output = '<p>' . t('Download additional <a href="@modules">contributed modules</a> to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>';
if (\Drupal::moduleHandler()->moduleExists('update')) {
if (update_manager_access()) {
$output .= '<p>' . t('Regularly review and install <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => $base_url . '/core/update.php', '@updates' => \Drupal::url('update.status'))) . '</p>';
$output .= '<p>' . t('Regularly review and install <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => \Drupal::url('system.db_update'), '@updates' => \Drupal::url('update.status'))) . '</p>';
}
else {
$output .= '<p>' . t('Regularly review <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => $base_url . '/core/update.php', '@updates' => \Drupal::url('update.status'))) . '</p>';
$output .= '<p>' . t('Regularly review <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => \Drupal::url('system.db_update'), '@updates' => \Drupal::url('update.status'))) . '</p>';
}
}
else {
$output .= '<p>' . t('Regularly review available updates to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated. Enable the Update Manager module to update and install modules and themes.', array('@update-php' => $base_url . '/core/update.php')) . '</p>';
$output .= '<p>' . t('Regularly review available updates to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated. Enable the Update Manager module to update and install modules and themes.', array('@update-php' => \Drupal::url('system.db_update'))) . '</p>';
}
return $output;
......
......@@ -227,7 +227,7 @@ function update_authorize_update_batch_finished($success, $results) {
// Since we're doing an update of existing code, always add a task for
// running update.php.
$results['tasks'][] = t('Your modules have been downloaded and updated.');
$results['tasks'][] = t('<a href="@update">Run database updates</a>', array('@update' => base_path() . 'core/update.php'));
$results['tasks'][] = t('<a href="@update">Run database updates</a>', array('@update' => \Drupal::url('system.db_update')));
// Unset the variable since it is no longer needed.
unset($_SESSION['maintenance_mode']);
......
......@@ -615,7 +615,7 @@ function update_verify_update_archive($project, $archive_file, $directory) {
// Make sure this isn't a tarball of Drupal core.
if (
file_exists("$directory/$project/index.php")
&& file_exists("$directory/$project/core/update.php")
&& file_exists("$directory/$project/core/install.php")
&& file_exists("$directory/$project/core/includes/bootstrap.inc")
&& file_exists("$directory/$project/core/modules/node/node.module")
&& file_exists("$directory/$project/core/modules/system/system.module")
......
......@@ -44,7 +44,7 @@
i.e. if URI is set to http://default/bar/foo.php
and bar/foo.php exists, this script will be executed without
bootstrapping Drupal. To execute Drupal's update.php, specify
http://default/core/update.php as the URI.
http://default/update.php as the URI.
To run this script without --root argument invoke it from the root directory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment