Fixed redlinks to special pages + parameters
authorDan
Fri, 30 Jul 2010 15:49:23 -0400
changeset 1278 9a4b0c3056ac
parent 1277 4264ace0855f
child 1279 0bc945385d74
Fixed redlinks to special pages + parameters
includes/namespaces/special.php
--- a/includes/namespaces/special.php	Fri Jul 30 15:49:11 2010 -0400
+++ b/includes/namespaces/special.php	Fri Jul 30 15:49:23 2010 -0400
@@ -31,7 +31,11 @@
 		global $db, $session, $paths, $template, $plugins; // Common objects
 		global $lang;
 		
-		$this->exists = function_exists("page_{$this->namespace}_{$this->page_id}");
+		if ( strstr($this->page_id, '/') )
+			list($base_page_id) = explode('/', $this->page_id);
+		else
+			$base_page_id = $this->page_id;
+		$this->exists = function_exists("page_{$this->namespace}_{$base_page_id}");
 		
 		if ( isset($paths->pages[ $paths->get_pathskey($this->page_id, $this->namespace) ]) )
 		{
@@ -57,7 +61,7 @@
 				'delvotes' => 0,
 				'delvote_ips' => '',
 				'wiki_mode' => 2,
-				'page_exists' => false,
+				'page_exists' => $this->exists,
 				'page_format' => getConfig('default_page_format', 'wikitext')
 			);
 		$this->cdata = Namespace_Default::bake_cdata($this->cdata);