summaryrefslogtreecommitdiff
path: root/modules/dblog/dblog.module
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2016-02-01 00:22:40 -0500
committerDavid Rothstein <drothstein@gmail.com>2016-02-01 00:22:40 -0500
commitd77ba6e7a8794aae5f46f3fed728c725b2e24e18 (patch)
tree372f121f639b7dfda5809ef581a7e26867c41126 /modules/dblog/dblog.module
parent116f6ec5089bf184d395a670248c41f2a2354169 (diff)
downloadbrdo-d77ba6e7a8794aae5f46f3fed728c725b2e24e18.tar.gz
brdo-d77ba6e7a8794aae5f46f3fed728c725b2e24e18.tar.bz2
Issue #1328014 by eiriksm, superspring, jhedstrom, alexpott, franz, chx, phillamb168: Fix PDOException in the dblog module when saving a link URL with non-standard characters
Diffstat (limited to 'modules/dblog/dblog.module')
-rw-r--r--modules/dblog/dblog.module9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module
index 9183eed69..eb79faffc 100644
--- a/modules/dblog/dblog.module
+++ b/modules/dblog/dblog.module
@@ -144,17 +144,20 @@ function _dblog_get_message_types() {
* Note: Some values may be truncated to meet database column size restrictions.
*/
function dblog_watchdog(array $log_entry) {
+ if (!function_exists('drupal_substr')) {
+ require_once DRUPAL_ROOT . '/includes/unicode.inc';
+ }
Database::getConnection('default', 'default')->insert('watchdog')
->fields(array(
'uid' => $log_entry['uid'],
- 'type' => substr($log_entry['type'], 0, 64),
+ 'type' => drupal_substr($log_entry['type'], 0, 64),
'message' => $log_entry['message'],
'variables' => serialize($log_entry['variables']),
'severity' => $log_entry['severity'],
- 'link' => substr($log_entry['link'], 0, 255),
+ 'link' => drupal_substr($log_entry['link'], 0, 255),
'location' => $log_entry['request_uri'],
'referer' => $log_entry['referer'],
- 'hostname' => substr($log_entry['ip'], 0, 128),
+ 'hostname' => drupal_substr($log_entry['ip'], 0, 128),
'timestamp' => $log_entry['timestamp'],
))
->execute();