Fix: internal links parsed with RenderMan::parse_internal_links() did not get namespaces prepended; added Project: alias namespace for internal links
authorDan
Tue, 18 Sep 2007 17:03:03 -0400
changeset 136 f2ee42f026f7
parent 135 c5dbad7ec2d0
child 137 3bce0c320e80
Fix: internal links parsed with RenderMan::parse_internal_links() did not get namespaces prepended; added Project: alias namespace for internal links
includes/render.php
--- a/includes/render.php	Tue Sep 18 16:29:26 2007 -0400
+++ b/includes/render.php	Tue Sep 18 17:03:03 2007 -0400
@@ -19,6 +19,13 @@
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
     $k = array_keys($paths->nslist);
+    $proj_alt = 'Project:';
+    if ( substr($string, 0, (strlen($proj_alt))) == $proj_alt )
+    {
+      $ns = 'Project';
+      $pg = substr($string, strlen($proj_alt), strlen($string));
+      return Array($pg, $ns);
+    }
     for($i=0;$i<sizeof($paths->nslist);$i++)
     {
       $ln = strlen($paths->nslist[$k[$i]]);
@@ -426,6 +433,7 @@
   
   function parse_internal_links($text)
   {
+    global $db, $session, $paths, $template, $plugins; // Common objects
     
     // stage 1 - links with alternate text
     preg_match_all('/\[\[([^\[\]<>\{\}\|]+)\|(.+?)\]\]/', $text, $matches);