From 9ed00c2eec762f43aaed748c5148e7bd65927f38 Mon Sep 17 00:00:00 2001
From: jan <jan@jandecaluwe.com>
Date: Wed, 30 Mar 2005 16:48:57 +0200
Subject: [PATCH] Make useheading work again

darcs-hash:20050330144857-45605-a7811307313366b3895fd8718de7df8733ac2aaa.gz
---
 inc/format.php | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/inc/format.php b/inc/format.php
index 2dbb43a97..1f17dce74 100644
--- a/inc/format.php
+++ b/inc/format.php
@@ -89,18 +89,6 @@ function format_link_wiki($link){
   list($link['url'],$hash) = split('#',$link['url'],2);
   $hash = cleanID($hash);
 
-  //if no name set, use (unclean) link without namespace
-  if(empty($link['name'])){
-    if($conf['useslash']){
-      $nssep = '[:;/]';
-    }else{
-      $nssep = '[:;]';
-    }
-    $link['name'] = preg_replace('!.*'.$nssep.'!','',$link['url']);
-    $link['name'] = htmlspecialchars($link['name']);
-  }
-
-
   $file = wikiFN($link['url']);
   $url  = cleanID($link['url']);
 
@@ -129,6 +117,17 @@ function format_link_wiki($link){
     $link['class']="wikilink2";
   }
 
+  //if no name set yet, use (unclean) link without namespace
+  if(empty($link['name'])){
+    if($conf['useslash']){
+      $nssep = '[:;/]';
+    }else{
+      $nssep = '[:;]';
+    }
+    $link['name'] = preg_replace('!.*'.$nssep.'!','',$link['url']);
+  }
+  $link['name'] = htmlspecialchars($link['name']);
+
   //set title
   $link['title'] = $url;
 
-- 
GitLab