diff options
author | David Rothstein <drothstein@gmail.com> | 2016-02-01 00:22:40 -0500 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2016-02-01 00:22:40 -0500 |
commit | d77ba6e7a8794aae5f46f3fed728c725b2e24e18 (patch) | |
tree | 372f121f639b7dfda5809ef581a7e26867c41126 /modules/dblog/dblog.module | |
parent | 116f6ec5089bf184d395a670248c41f2a2354169 (diff) | |
download | brdo-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.module | 9 |
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(); |