From e779a880ca1042606f76373c0c299adb57e074bc Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 2 Feb 2010 00:55:34 +0000 Subject: [PATCH] link to image in the event log --- contrib/log_db/theme.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/contrib/log_db/theme.php b/contrib/log_db/theme.php index 56aaa2ab..94f273b4 100644 --- a/contrib/log_db/theme.php +++ b/contrib/log_db/theme.php @@ -20,7 +20,7 @@ class LogDatabaseTheme extends Themelet { "".html_escape($event['username'])."". ""; } - $table .= "".html_escape($event['message']).""; + $table .= "".$this->scan_entities(html_escape($event['message'])).""; $table .= "\n"; } $table .= ""; @@ -42,5 +42,15 @@ class LogDatabaseTheme extends Themelet { default: return ""; } } + + protected function scan_entities($line) { + $line = preg_replace_callback("/Image #(\d+)/s", array($this, "link_image"), $line); + return $line; + } + + protected function link_image($id) { + $iid = int_escape($id[1]); + return "Image #$iid"; + } } ?>