diff --git a/html/modules/legacy/kernel/Legacy_TextFilter.class.php b/html/modules/legacy/kernel/Legacy_TextFilter.class.php
index a4fb657f0..9a8c3981f 100644
--- a/html/modules/legacy/kernel/Legacy_TextFilter.class.php
+++ b/html/modules/legacy/kernel/Legacy_TextFilter.class.php
@@ -325,7 +325,16 @@ public function makeClickable($text)
//
$this->mMakeClickablePre->call(new XCube_Ref($this->mClickablePatterns), new XCube_Ref($this->mClickableReplacements));
}
- $text = preg_replace($this->mClickablePatterns, $this->mClickableReplacements, $text);
+ foreach ($this->mClickablePatterns as $arrayIndex => $pattern) {
+ $replacement = $this->mClickableReplacements[$arrayIndex];
+
+ if (is_callable($replacement)) {
+ $text = preg_replace_callback($pattern, $replacement, $text);
+ }else {
+ $text = preg_replace($pattern, $replacement, $text);
+ }
+ }
+
return $text;
}