loop through args in common_markup_to_html

This commit is contained in:
Evan Prodromou 2011-04-18 09:51:26 -04:00
parent b72788d9ce
commit 28d0d9caad
1 changed files with 6 additions and 1 deletions

View File

@ -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);