From a4496bdde92f13cee9962865590182ce320c394f Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Tue, 13 May 2014 16:05:39 +0200 Subject: [PATCH] MDL-36670 logging: action parameter length restricted to 40 chars --- admin/tool/log/store/legacy/classes/log/store.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/admin/tool/log/store/legacy/classes/log/store.php b/admin/tool/log/store/legacy/classes/log/store.php index eb75d4bd1ce..48d561ead0c 100644 --- a/admin/tool/log/store/legacy/classes/log/store.php +++ b/admin/tool/log/store/legacy/classes/log/store.php @@ -185,6 +185,11 @@ class store implements \tool_log\log\store, \core\log\sql_select_reader { // database so that it doesn't cause a DB error. Log a warning so that // developers can avoid doing things which are likely to cause this on a // routine basis. + if (\core_text::strlen($action) > 40) { + $action = \core_text::substr($action, 0, 37) . '...'; + debugging('Warning: logged very long action', DEBUG_DEVELOPER); + } + if (!empty($info) && \core_text::strlen($info) > 255) { $info = \core_text::substr($info, 0, 252) . '...'; debugging('Warning: logged very long info', DEBUG_DEVELOPER);