From 28d0d9caadab0e57c53bce60f897c47d6dca8207 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 18 Apr 2011 09:51:26 -0400 Subject: [PATCH] loop through args in common_markup_to_html --- lib/util.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/util.php b/lib/util.php index be954feb49..07a344633b 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1937,7 +1937,12 @@ function common_markup_to_html($c, $args=null) $args = array(); } - $c = preg_replace('/%%arg.(\w+)%%/', "{$args['\\1']}", $c); + // XXX: not very efficient + + foreach ($args as $name => $value) { + $c = preg_replace('/%%arg.'.$name.'%%/', $value, $c); + } + $c = preg_replace('/%%user.(\w+)%%/e', "common_user_property('\\1')", $c); $c = preg_replace('/%%action.(\w+)%%/e', "common_local_url('\\1')", $c); $c = preg_replace('/%%doc.(\w+)%%/e', "common_local_url('doc', array('title'=>'\\1'))", $c); -- 2.39.5