Commit f7e61d77 authored by Dries's avatar Dries
Browse files

- Patch #296321 by pwolanin, swentel: link to cron.php broken when clean URLs are disabled.

parent 0ff80347
......@@ -10,6 +10,7 @@
* An array of system requirements.
*/
function system_requirements($phase) {
global $base_url;
$requirements = array();
// Ensure translations don't break at install time
$t = get_t();
......@@ -171,7 +172,7 @@ function system_requirements($phase) {
}
$description .= ' ' . $t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/reports/status/run-cron')));
$description .= '<br />' . $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url('cron.php', array('absolute' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal')))));
$description .= '<br />' . $t('To run cron from outside the site, go to <a href="!cron">!cron</a>', array('!cron' => url($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . variable_get('cron_key', 'drupal')))));
$requirements['cron'] = array(
'title' => $t('Cron maintenance tasks'),
......
......@@ -234,18 +234,19 @@ class CronRunTestCase extends DrupalWebTestCase {
* Test cron runs.
*/
function testCronRun() {
global $base_url;
// Run cron anonymously without any cron key.
$this->drupalGet('cron.php');
$this->drupalGet($base_url . '/cron.php', array('external' => TRUE));
$this->assertResponse(403);
// Run cron anonymously with a random cron key.
$key = $this->randomName(16);
$this->drupalGet('cron.php', array('query' => 'cron_key=' . $key));
$this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key));
$this->assertResponse(403);
// Run cron anonymously with the valid cron key.
$key = variable_get('cron_key', 'drupal');
$this->drupalGet('cron.php', array('query' => 'cron_key=' . $key));
$this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key));
$this->assertResponse(200);
// Execute cron directly.
......
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