drupal_not_found
includes/common.inc, строка 343
- Версии
- 5 – 6
drupal_not_found()
Генерирует ошибку 404 (страница не найдена) если запрос не удалось обработать.
Код
<?php
function drupal_not_found() {
drupal_set_header('HTTP/1.1 404 Not Found');
watchdog('page not found', check_plain($_GET['q']), WATCHDOG_WARNING);
// Keep old path for reference
if (!isset($_REQUEST['destination'])) {
$_REQUEST['destination'] = $_GET['q'];
}
$path = drupal_get_normal_path(variable_get('site_404', ''));
if ($path && $path != $_GET['q']) {
menu_set_active_item($path);
$return = menu_execute_active_handler();
}
else {
// Redirect to a non-existent menu item to make possible tabs disappear.
menu_set_active_item('');
}
if (empty($return) || $return == MENU_NOT_FOUND || $return == MENU_ACCESS_DENIED) {
drupal_set_title(t('Page not found'));
menu_set_active_item('');
$return = '';
}
// To conserve CPU and bandwidth, omit the blocks
print theme('page', $return, FALSE);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии