MDL-36670 logging: action parameter length restricted to 40 chars

This commit is contained in:
Juan Leyva 2014-05-13 16:05:39 +02:00
parent c1ed254643
commit a4496bdde9

View File

@ -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);