From: Evan Prodromou Date: Mon, 18 Apr 2011 13:51:26 +0000 (-0400) Subject: loop through args in common_markup_to_html X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=28d0d9caadab0e57c53bce60f897c47d6dca8207;p=quix0rs-gnu-social.git loop through args in common_markup_to_html --- 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);