From 3ff8773b99e0d5d72f4e4e574b20e8004f57bd69 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sun, 16 Oct 2005 20:57:09 +0200
Subject: [PATCH] make sure p_wiki_xhtml does not destroy the global $ID

darcs-hash:20051016185709-7ad00-cf9de03231c90e1c6725fe7553909d682bca1a59.gz
---
 inc/parserutils.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/inc/parserutils.php b/inc/parserutils.php
index 5b0e802bc..ba8d8df36 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -27,7 +27,8 @@ function p_wiki_xhtml($id, $rev='', $excuse=true){
   
   //ensure $id is in global $ID (needed for parsing)
   global $ID;
-  $ID = $id;
+  $keep = $ID;
+  $ID   = $id;
 
   if($rev){
     if(@file_exists($file)){
@@ -43,6 +44,9 @@ function p_wiki_xhtml($id, $rev='', $excuse=true){
     }
   }
 
+  //restore ID (just in case)
+  $ID = $keep;
+
   return $ret;
 }
 
-- 
GitLab