1 diff -uNdr drupal-5.7.old/cron.php drupal-5.7/cron.php
2 --- drupal-5.7.old/cron.php 2006-08-09 09:42:55.000000000 +0200
3 +++ drupal-5.7/cron.php 2008-02-16 15:50:48.000000000 +0100
10 * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
13 +// If not in 'safe mode', increase the memory limit
14 +if (!ini_get('safe_mode')) {
15 + ini_set('memory_limit', '20M');
18 +chdir(dirname(__FILE__));
20 include_once './includes/bootstrap.inc';
21 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
23 diff -uNdr drupal-5.7.old/includes/bootstrap.inc drupal-5.7/includes/bootstrap.inc
24 --- drupal-5.7.old/includes/bootstrap.inc 2008-01-10 23:14:24.000000000 +0100
25 +++ drupal-5.7/includes/bootstrap.inc 2008-02-16 16:02:23.000000000 +0100
29 $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);
30 - $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
31 + $server = explode('.', implode('.', array_reverse(explode(':', rtrim(@$_SERVER['HTTP_HOST'], '.')))));
32 for ($i = count($uri) - 1; $i > 0; $i--) {
33 for ($j = count($server); $j > 0; $j--) {
34 $dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));
36 global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile;
39 - include_once './'. conf_path() .'/settings.php';
40 + include_once conf_path() .'/settings.php';
42 if (isset($base_url)) {
43 // Parse fixed base URL from settings.php.
46 // As $_SERVER['HTTP_HOST'] is user input, ensure it only contains
47 // characters allowed in hostnames.
48 - $base_url = $base_root .= '://'. preg_replace('/[^a-z0-9-:._]/i', '', $_SERVER['HTTP_HOST']);
49 + $base_url = $base_root .= '://'. preg_replace('/[^a-z0-9-:._]/i', '', @$_SERVER['HTTP_HOST']);
51 // $_SERVER['SCRIPT_NAME'] can, in contrast to $_SERVER['PHP_SELF'], not
52 // be modified by a visitor.
55 case DRUPAL_BOOTSTRAP_ACCESS:
56 // Deny access to hosts which were banned - t() is not yet available.
57 - if (drupal_is_denied('host', $_SERVER['REMOTE_ADDR'])) {
58 + if (drupal_is_denied('host', @$_SERVER['REMOTE_ADDR'])) {
59 header('HTTP/1.1 403 Forbidden');
60 print 'Sorry, '. $_SERVER['REMOTE_ADDR']. ' has been banned.';