|
@@ -607,6 +607,7 @@ function list_getModLogEntries($start, $items_per_page, $sort, $query_string = '
|
|
|
}
|
|
|
|
|
|
|
|
|
+ $callback = pregReplaceCurry('list_getModLogEntriesCallback', 3);
|
|
|
foreach ($entries as $k => $entry)
|
|
|
{
|
|
|
|
|
@@ -620,11 +621,29 @@ function list_getModLogEntries($start, $items_per_page, $sort, $query_string = '
|
|
|
|
|
|
if (empty($entries[$k]['action_text']))
|
|
|
$entries[$k]['action_text'] = isset($txt['modlog_ac_' . $entry['action']]) ? $txt['modlog_ac_' . $entry['action']] : $entry['action'];
|
|
|
- $entries[$k]['action_text'] = preg_replace('~\{([A-Za-z\d_]+)\}~ie', 'isset($entries[$k][\'extra\'][\'$1\']) ? $entries[$k][\'extra\'][\'$1\'] : \'\'', $entries[$k]['action_text']);
|
|
|
+ $entries[$k]['action_text'] = preg_replace_callback('~\{([A-Za-z\d_]+)\}~i', $callback($entries, $k), $entries[$k]['action_text']);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
return $entries;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * Smiely Replacment Callback.
|
|
|
+ *
|
|
|
+ * Our callback that does the actual smiley replacments.
|
|
|
+ *
|
|
|
+ * Original code from: http:
|
|
|
+ * This is needed until SMF only supports PHP 5.3+ and we change to "use"
|
|
|
+ *
|
|
|
+ * @param string $replacements
|
|
|
+ * @param string $matches
|
|
|
+ * @return string the replaced results.
|
|
|
+ */
|
|
|
+function list_getModLogEntriesCallback($entries, $key, $matches)
|
|
|
+{
|
|
|
+ return isset($entries[$key]['extra'][$matches[1]]) ? $entries[$key]['extra'][$matches[1]] : '';
|
|
|
+}
|
|
|
+
|
|
|
?>
|