Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
bfee7d05
Commit
bfee7d05
authored
Apr 02, 2012
by
Nathaniel Catchpole
Browse files
Issue
#598586
by grendzy, deekayen, matglas86, dawehner: Fixed watchdog() assumes is defined.
parent
a3d299b8
Changes
6
Hide whitespace changes
Inline
Side-by-side
core/includes/bootstrap.inc
View file @
bfee7d05
...
...
@@ -1585,6 +1585,9 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
if
(
!
$in_error_state
&&
function_exists
(
'module_implements'
))
{
$in_error_state
=
TRUE
;
// The user object may not exist in all conditions, so 0 is substituted if needed.
$user_uid
=
isset
(
$user
->
uid
)
?
$user
->
uid
:
0
;
// Prepare the fields to be logged
$log_entry
=
array
(
'type'
=>
$type
,
...
...
@@ -1593,6 +1596,7 @@ function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NO
'severity'
=>
$severity
,
'link'
=>
$link
,
'user'
=>
$user
,
'uid'
=>
$user_uid
,
'request_uri'
=>
$base_root
.
request_uri
(),
'referer'
=>
isset
(
$_SERVER
[
'HTTP_REFERER'
])
?
$_SERVER
[
'HTTP_REFERER'
]
:
''
,
'ip'
=>
ip_address
(),
...
...
core/includes/theme.inc
View file @
bfee7d05
...
...
@@ -2147,7 +2147,7 @@ function theme_item_list($variables) {
// Only output the list container and title, if there are any list items.
if
(
$output
!==
''
)
{
if
(
$title
!==
''
)
{
if
(
!
empty
(
$title
)
)
{
$title
=
'<h3>'
.
$title
.
'</h3>'
;
}
$output
=
'<div class="item-list">'
.
$title
.
$output
.
'</div>'
;
...
...
core/modules/dblog/dblog.module
View file @
bfee7d05
...
...
@@ -140,12 +140,9 @@ function _dblog_get_message_types() {
* Note some values may be truncated for database column size restrictions.
*/
function
dblog_watchdog
(
array
$log_entry
)
{
// The user object may not exist in all conditions, so 0 is substituted if needed.
$user_uid
=
isset
(
$log_entry
[
'user'
]
->
uid
)
?
$log_entry
[
'user'
]
->
uid
:
0
;
Database
::
getConnection
(
'default'
,
'default'
)
->
insert
(
'watchdog'
)
->
fields
(
array
(
'uid'
=>
$
user_
uid
,
'uid'
=>
$
log_entry
[
'
uid
'
]
,
'type'
=>
substr
(
$log_entry
[
'type'
],
0
,
64
),
'message'
=>
$log_entry
[
'message'
],
'variables'
=>
serialize
(
$log_entry
[
'variables'
]),
...
...
core/modules/dblog/dblog.test
View file @
bfee7d05
...
...
@@ -107,6 +107,7 @@ class DBLogTestCase extends DrupalWebTestCase {
'severity'
=>
$severity
,
'link'
=>
NULL
,
'user'
=>
$this
->
big_user
,
'uid'
=>
isset
(
$this
->
big_user
->
uid
)
?
$this
->
big_user
->
uid
:
0
,
'request_uri'
=>
$base_root
.
request_uri
(),
'referer'
=>
$_SERVER
[
'HTTP_REFERER'
],
'ip'
=>
ip_address
(),
...
...
@@ -388,6 +389,7 @@ class DBLogTestCase extends DrupalWebTestCase {
'severity'
=>
WATCHDOG_NOTICE
,
'link'
=>
NULL
,
'user'
=>
$this
->
big_user
,
'uid'
=>
isset
(
$this
->
big_user
->
uid
)
?
$this
->
big_user
->
uid
:
0
,
'request_uri'
=>
$base_root
.
request_uri
(),
'referer'
=>
$_SERVER
[
'HTTP_REFERER'
],
'ip'
=>
ip_address
(),
...
...
core/modules/simpletest/tests/actions_loop_test.module
View file @
bfee7d05
...
...
@@ -66,6 +66,7 @@ function watchdog_skip_semaphore($type, $message, $variables = array(), $severit
'severity'
=>
$severity
,
'link'
=>
$link
,
'user'
=>
$user
,
'uid'
=>
isset
(
$user
->
uid
)
?
$user
->
uid
:
0
,
'request_uri'
=>
$base_root
.
request_uri
(),
'referer'
=>
$_SERVER
[
'HTTP_REFERER'
],
'ip'
=>
ip_address
(),
...
...
core/modules/syslog/syslog.module
View file @
bfee7d05
...
...
@@ -109,7 +109,7 @@ function syslog_watchdog(array $log_entry) {
'!ip'
=>
$log_entry
[
'ip'
],
'!request_uri'
=>
$log_entry
[
'request_uri'
],
'!referer'
=>
$log_entry
[
'referer'
],
'!uid'
=>
$log_entry
[
'u
ser'
]
->
u
id
,
'!uid'
=>
$log_entry
[
'uid
'
]
,
'!link'
=>
strip_tags
(
$log_entry
[
'link'
]),
'!message'
=>
strip_tags
(
!
isset
(
$log_entry
[
'variables'
])
?
$log_entry
[
'message'
]
:
strtr
(
$log_entry
[
'message'
],
$log_entry
[
'variables'
])),
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment