diff --git a/.htaccess b/.htaccess index c32b1821198504bb450c08c9a0e1cdb136effb3a..0ad7be304817441f91df826d91123e4359e039ff 100644 --- a/.htaccess +++ b/.htaccess @@ -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$ diff --git a/core/UPGRADE.txt b/core/UPGRADE.txt index 420f6ad2a3648beb9f96c8c5c9c8e5129d398c2b..7c700505e2c16521fdae70fb0701cf38afa10846 100644 --- a/core/UPGRADE.txt +++ b/core/UPGRADE.txt @@ -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. diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index b4c2567b72b228abc45103243e18ac46424f8609..6a9b78d8b88f61e77d6a8d3a94bfa8bb3713532c 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -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(). diff --git a/core/lib/Drupal/Core/Installer/Exception/AlreadyInstalledException.php b/core/lib/Drupal/Core/Installer/Exception/AlreadyInstalledException.php index 3bdb0a3fc9f490841eb9f771abb2fc3f4ecfbe9b..19436b0cfc615f148b1f852610b36dc082299800 100644 --- a/core/lib/Drupal/Core/Installer/Exception/AlreadyInstalledException.php +++ b/core/lib/Drupal/Core/Installer/Exception/AlreadyInstalledException.php @@ -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); } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 788b9e10a74b181dc57807733e656a513c806e75..868b2eba1195f8fb17222a1bc0f62651650c6dfd 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -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'))); } } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index a44b1fe02b893ecebb2f233ccf9bfc309a04ae64..d02573b04274d4d1299c7d303f85de9ce04b029c 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -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; diff --git a/core/modules/update/update.authorize.inc b/core/modules/update/update.authorize.inc index 3bfdbcf4bcd6dff1d009f6e3953a5b9178d05305..8709e56e6324ae87225f03e26b2cf3380d5c9188 100644 --- a/core/modules/update/update.authorize.inc +++ b/core/modules/update/update.authorize.inc @@ -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']); diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 061937606f314ed9ef05e33f60c64a963a420eaa..44aa884a3e223c3e3a7c4f6102be69fa60587100 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -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") diff --git a/core/scripts/drupal.sh b/core/scripts/drupal.sh index 951434150cb0204a1f657b6e801e9cf389058b2a..de8e864b62f1509b083667f3d9ccc2eead456cea 100755 --- a/core/scripts/drupal.sh +++ b/core/scripts/drupal.sh @@ -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