Commit 5aa641ae authored by catch's avatar catch

Issue #1279680 by tmsimont: Allow NULL as a watchdog() argument while retaining array type hinting.

parent 2c98c16e
......@@ -43,7 +43,7 @@
*/
function authorize_access_denied_page() {
drupal_add_http_header('Status', '403 Forbidden');
watchdog('access denied', 'authorize.php', array(), WATCHDOG_WARNING);
watchdog('access denied', 'authorize.php', NULL, WATCHDOG_WARNING);
drupal_set_title('Access denied');
return t('You are not allowed to access this page.');
}
......
......@@ -1663,8 +1663,9 @@ function request_uri($omit_query_string = FALSE) {
* The message to store in the log. If empty, a text that contains all useful
* information about the passed-in exception is used.
* @param $variables
* Array of variables to replace in the message on display. Defaults to the
* return value of drupal_decode_exception().
* Array of variables to replace in the message on display or
* NULL if message is already translated or not possible to
* translate.
* @param $severity
* The severity of the message, as per RFC 3164.
* @param $link
......@@ -1722,7 +1723,7 @@ function watchdog_exception($type, Exception $exception, $message = NULL, $varia
* @see watchdog_severity_levels()
* @see hook_watchdog()
*/
function watchdog($type, $message, array $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) {
function watchdog($type, $message, array $variables = NULL, $severity = WATCHDOG_NOTICE, $link = NULL) {
global $user, $base_root;
static $in_error_state = FALSE;
......
......@@ -99,7 +99,7 @@ public function on405Html(FlattenException $exception, Request $request) {
*/
public function on403Html(FlattenException $exception, Request $request) {
$system_path = $request->attributes->get('system_path');
watchdog('access denied', $system_path, array(), WATCHDOG_WARNING);
watchdog('access denied', $system_path, NULL, WATCHDOG_WARNING);
$path = $this->container->get('path.alias_manager')->getSystemPath(config('system.site')->get('page.403'));
if ($path && $path != $system_path) {
......@@ -153,7 +153,7 @@ public function on403Html(FlattenException $exception, Request $request) {
* The request object that triggered this exception.
*/
public function on404Html(FlattenException $exception, Request $request) {
watchdog('page not found', check_plain($request->attributes->get('system_path')), array(), WATCHDOG_WARNING);
watchdog('page not found', check_plain($request->attributes->get('system_path')), NULL, WATCHDOG_WARNING);
// Check for and return a fast 404 page if configured.
$exclude_paths = variable_get('404_fast_paths_exclude', FALSE);
......
......@@ -37,7 +37,7 @@ function setUp() {
// Insert 300 log messages.
for ($i = 0; $i < 300; $i++) {
watchdog('pager_test', $this->randomString(), array(), WATCHDOG_DEBUG);
watchdog('pager_test', $this->randomString(), NULL, WATCHDOG_DEBUG);
}
$this->admin_user = $this->drupalCreateUser(array(
......
......@@ -306,7 +306,7 @@ function update_info_page() {
*/
function update_access_denied_page() {
drupal_add_http_header('Status', '403 Forbidden');
watchdog('access denied', 'update.php', array(), WATCHDOG_WARNING);
watchdog('access denied', 'update.php', NULL, WATCHDOG_WARNING);
drupal_set_title('Access denied');
return '<p>Access denied. You are not authorized to access this page. Log in using either an account with the <em>administer software updates</em> permission or the site maintenance account (the account you created during installation). If you cannot log in, you will have to edit <code>settings.php</code> to bypass this access check. To do this:</p>
<ol>
......
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