]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
loop through args in common_markup_to_html
authorEvan Prodromou <evan@status.net>
Mon, 18 Apr 2011 13:51:26 +0000 (09:51 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 18 Apr 2011 13:51:26 +0000 (09:51 -0400)
lib/util.php

index be954feb49bcf94ee50fb1b858c0226c75864f3c..07a344633bd8541ba4a492a31751696c343a37b5 100644 (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);