Retour [./2.19_3/index.php]
show/hide
0
1 <?php
2 // TigerWiki 2 (Version 2.19 - 2006-11-02)
3 // Copyleft (C) Arsenic 2005-2006, licence GNU/GPL (disponible sur www.gnu.org)
4 // http://chabel.org/ - root chez chabel point org
5 $WIKI_VERSION = "TigerWiki 2.19+3";
6
7 //Fichier de configuration
8 include("_config.php");
9
10 /** test si l'utilisateur est authentifié
11 * pose cookie si absent
12 */
13 function authentified()
14 {
15 global $PASSWORD;
16 if (($_COOKIE['AutorisationTigerWiki'] == md5($PASSWORD)) || ($_POST["sc"] == $PASSWORD))
17 {
18 if (($PASSWORD != "") && empty($_COOKIE['AutorisationTigerWiki'])) {
19 $pwd=md5($PASSWORD);
20 setcookie('AutorisationTigerWiki',$pwd, time() + 365*24*3600);
21 $_COOKIE['AutorisationTigerWiki'] = $pwd;
22 }
23 return TRUE;
24 }
25 else
26 return FALSE;
27 } // authentified()
28
29 /** Verifie la validite d'un path
30 * retire .., ^/, //, /$ et decode un chemin
31 * input: le path
32 * return le path corrigé
33 */
34 function cleanInput($input)
35 {
36 return trim(preg_replace('/(\.\.|^\/|\/\/)/','',urldecode($input)),'/');
37 }
38
39 // Effacement du cookie
40 if ($_GET['erasecookie'] == 1)
41 {
42 setcookie('AutorisationTigerWiki');
43 $_COOKIE['AutorisationTigerWiki'] = ""; // JJL: remove cookie without reloading
44 }
45
46 // Trouver la page a afficher
47 if (! $PAGE_TITLE = stripslashes($_GET["page"]))
48 {
49 if ($_GET["action"] == "search")
50 if ($_GET["query"] != "")
51 $PAGE_TITLE = "$SEARCH_RESULTS \"$_GET[query]\"";
52 else
53 $PAGE_TITLE = $LIST . " (" . count(glob("$PAGES_DIR/*.*")) . ")";
54 elseif ($_GET["action"] == "recent")
55 $PAGE_TITLE = "$RECENT_CHANGES";
56 elseif ($_GET["action"] == "upload") // JJL upload
57 $PAGE_TITLE = $UPLOAD_BUTTON;
58 else
59 $PAGE_TITLE = "$START_PAGE";
60 }
61 if ($_GET["page"] == $UPLOAD_BUTTON)
62 $action="upload";
63 else
64 $action = $_GET["action"];
65
66 if (isset($_GET["time"]))
67 $gtime = $_GET["time"];
68 $datetw = date("Y/m/d H:i", mktime(date("H") + $LOCAL_HOUR));
69
70 // Arreter les acces malicieux via repertoire et accents
71 if (preg_match("/\//", $PAGE_TITLE))
72 $PAGE_TITLE = $START_PAGE;
73 if (preg_match("/\//", $gtime))
74 $gtime = '';
75
76 // Ecrire les modifications, s'il y a lieu
77 if ($_POST["content"] != "")
78 {
79 if ($_SERVER["REQUEST_METHOD"] == "POST")
80 {
81 if (authentified())
82 {
83 if (! $file = @fopen($PAGES_DIR . stripslashes($_POST["page"]) . ".txt", "w"))
84 die("Could not write page!");
85 if (get_magic_quotes_gpc())
86 fputs($file, trim(stripslashes($_POST["content"])));
87 else
88 fputs($file, trim($_POST["content"]));
89 fclose($file);
90 if ($BACKUP_DIR <> '')
91 {
92 $complete_dir_s = $BACKUP_DIR . $_POST["page"] . "/";
93 if (! $dir = @opendir($complete_dir_s))
94 {
95 mkdir($complete_dir_s);
96 chmod($complete_dir_s,0777);
97 }
98 if (! $file = @fopen($complete_dir_s . date("Ymd-Hi", mktime(date("H") + $LOCAL_HOUR)) . ".bak", "a"))
99 die("Could not write backup of page!");
100 fputs($file, "\n// " . $datetw . " / " . " " . $_SERVER['REMOTE_ADDR'] . "\n");
101 if (get_magic_quotes_gpc())
102 fputs($file, trim(stripslashes($_POST["content"])));
103 else
104 fputs($file, trim($_POST["content"]) . "\n\n");
105 fclose($file);
106 }
107 include("ModuleRSS.php");
108 header("location: ./?page=" . urlencode(stripslashes($_POST[page])));
109 }
110 else
111 {
112 header("location: ./?page=" . $_POST[page]."&action=edit&error=1");
113 }
114 }
115 }
116 elseif (isset($_POST["content"]) && $_POST["content"] == "")
117 {
118 if (authentified())
119 {
120 unlink($PAGES_DIR . stripslashes($_POST["page"]) . ".txt");
121 }
122 else
123 header("location: ./?page=".$_POST["page"]."&action=edit&error=1");
124 }
125
126 // Lecture et analyse du mod�le de page
127 if (! $file = @fopen("template.html", "r"))
128 die("'template.html' is missing!");
129 $template = fread($file, filesize("template.html"));
130 fclose($file);
131
132 // Lecture du contenu et de la date de modification de la page
133 if (($file = @fopen($PAGES_DIR . $PAGE_TITLE . ".txt", "r")) || $action <> "")
134 {
135 if (file_exists($PAGES_DIR . $PAGE_TITLE . ".txt"))
136 $TIME = date("Y/m/d H:i", @filemtime($PAGES_DIR . $PAGE_TITLE . ".txt") + $LOCAL_HOUR * 3600);
137 $CONTENT = "\n" . @fread($file, @filesize($PAGES_DIR . $PAGE_TITLE . ".txt")) . "\n";
138 // Restaurer une page
139 if (isset($_GET["page"]) && isset($gtime) && $_GET["restore"] == 1)
140 if ($file = @fopen($BACKUP_DIR . $PAGE_TITLE . "/" . $gtime, "r"))
141 $CONTENT = "\n" . @fread($file, @filesize($BACKUP_DIR . $PAGE_TITLE . "/" . $gtime)) . "\n";
142 @fclose($file);
143 $CONTENT = preg_replace("/\\$/Umsi", "$", $CONTENT);
144 $CONTENT = preg_replace("/\\\/Umsi", "\", $CONTENT);
145 }
146 else
147 {
148 if (!file_exists($PAGES_DIR . $PAGE_TITLE . ".txt"))
149 $CONTENT = "\n" . $DEFAULT_CONTENT;
150 else
151 $action = "edit";
152 }
153
154 // D�terminer le mode d'acc�s
155 if ($action == "edit" || $action == "search" || $action == "recent" || $action == "upload")
156 $html = preg_replace('/{EDIT}/', $EDIT_BUTTON, $template);
157 elseif (is_writable($PAGES_DIR . $PAGE_TITLE . ".txt") || !file_exists($PAGES_DIR . $PAGE_TITLE . ".txt"))
158 $html = preg_replace('/{EDIT}/', "<a href=\"./?page=".$PAGE_TITLE."&action=edit\" accesskey=\"5\">$EDIT_BUTTON</a>", $template);
159 else
160 $html = preg_replace('/{EDIT}/', $PROTECTED_BUTTON, $template);
161 if ($action == "recent" || $action == "upload")
162 $html = preg_replace('/{RECENT_CHANGES}/', $RECENT_CHANGES, $html);
163 else
164 $html = preg_replace('/{RECENT_CHANGES}/', "<a href=\"./?action=recent\" accesskey=\"3\">$RECENT_CHANGES</a>", $html);
165
166
167 // Remplacer les variables par des valeurs (dans le style de page)
168 $html = preg_replace('/{PAGE_TITLE_BRUT}/', $PAGE_TITLE, $html);
169 if ($action != "" && $action != "recent" && $action != "search" && $action != "upload")
170 $html = preg_replace('/{PAGE_TITLE}/', "<a href=\"./?page=".$PAGE_TITLE."\">".$PAGE_TITLE."</a>", $html);
171 else
172 $html = preg_replace('/{PAGE_TITLE}/', $PAGE_TITLE, $html);
173 if ($PAGE_TITLE == $START_PAGE && $action <> "search")
174 $html = preg_replace('/{HOME}/', $HOME_BUTTON, $html);
175 else
176 $html = preg_replace('/{HOME}/', "<a href=\"./?page=".$START_PAGE."\" accesskey=\"1\">$HOME_BUTTON</a>", $html);
177 $html = preg_replace('/{WIKI_TITLE}/', $WIKI_TITLE, $html);
178 $html = preg_replace('/{LAST_CHANGE}/', $LAST_CHANGES." :", $html);
179 if ($action != "edit")
180 $html = preg_replace('/{HELP}/', "", $html);
181 else
182 $html = preg_replace('/{HELP}/', "(<a href=\"./?page=$HELP_BUTTON\" accesskey=\"2\">$HELP_BUTTON</a>)", $html);
183 $html = preg_replace('/{SEARCH}/', "<form method=\"get\" action=\"./?page=".$_GET[page]."\"><div><input type=\"hidden\" name=\"action\" value=\"search\" /><input type=\"text\" name=\"query\" value=\"$_GET[query]\" /> <input type=\"submit\" value=\"$SEARCH_BUTTON\" accesskey=\"q\" /></div></form>", $html);
184 if ($action == "edit")
185 {
186 $html = preg_replace('/{HISTORY}/', "/ <a href=\"?page=".$PAGE_TITLE."&action=history\" accesskey=\"6\">".$HISTORY_BUTTON."</a> / <a href=./?action=upload>".$UPLOAD_BUTTON."</a><br />", $html);
187 $CONTENT = "<form method=\"post\" action=\"./\"><textarea name=\"content\" cols=\"83\" rows=\"30\" style=\"width: 100%;\">$CONTENT</textarea><input type=\"hidden\" name=\"page\" value=\"".$PAGE_TITLE."\" /><br /><p align=\"right\">";
188 if (!authentified())
189 $CONTENT .= $MDP." : <input type=\"password\" name=\"sc\" />";
190 $CONTENT .= " <input type=\"submit\" value=\"$DONE_BUTTON\" accesskey=\"s\" /></p></div></form>";
191 }
192 elseif ($action != "history")
193 $html = preg_replace('/{HISTORY}/', "", $html);
194
195 // Liste des versions historiques d'une page
196 if ($action == "history" && !isset($gtime))
197 {
198 $html = preg_replace('/{HISTORY}/', "/ ".$HISTORY_BUTTON, $html);
199 $complete_dir = $BACKUP_DIR . $_GET["page"] . "/";
200 if ($opening_dir = @opendir($complete_dir))
201 {
202 while (false !== ($filename = @readdir($opening_dir)))
203 $files[] = $filename;
204 sort ($files);
205 for ($cptfiles = 2; $files[$cptfiles] != ''; $cptfiles++)
206 $affichage = $affichage."<a href=\"?page=".$_GET["page"]."&action=history&time=".$files[$cptfiles]."\">".$files[$cptfiles]."</a><br />";
207 $html = preg_replace('/{CONTENT}/', $affichage, $html);
208 }
209 else
210 $html = preg_replace('/{CONTENT}/', $NO_HISTORY, $html);
211 }
212
213 // Affichage d'un fichier historique
214 if ($action == "history" && isset($gtime))
215 {
216 $complete_dir = $BACKUP_DIR . $PAGE_TITLE . "/";
217 if ($file = @fopen($BACKUP_DIR . $PAGE_TITLE . "/" . $gtime, "r"))
218 {
219 $html = preg_replace('/{HISTORY}/', "/ <a href=\"?page=".$PAGE_TITLE."&action=history\">".$HISTORY_BUTTON."</a> (<a href=\"?page=".$PAGE_TITLE."&action=edit&time=".$gtime."&restore=1\">".$RESTORE."</a>)", $html);
220 $CONTENT = @fread($file, @filesize($complete_dir . $gtime)) . "\n";
221 }
222 else
223 $html = preg_replace('/{HISTORY}/', "/ <a href=\"?page=".$PAGE_TITLE."&action=history\">".$HISTORY_BUTTON."</a> (-)", $html);
224 }
225
226 // affichage/gestion des fichiers uploadés
227 if ($action == "upload")
228 {
229 if (is_dir($DATA_DIR))
230 {
231 // Set current dir
232 if (isset($_REQUEST['current']))
233 $current = cleanInput($_REQUEST['current']); // POST ou GET
234 if (!preg_match('/^'.trim($DATA_DIR,"/").'/',$current))
235 $current = trim($DATA_DIR,"/"); // on considere que $DATA_DIR est clean
236 $affichage .= "Entrez eventuellement votre mot de passe.<br/>Choississez le fichier à uploader en cliquant sur <i>Parcourir</i> ou le répertoire à créer. Cliquez sur <i>Envoyer</i><br/>Si vous êtes identifié, vous pouvez effacer un fichier en cliquant sur †<hr/>";
237 // Copie du fichier
238 if (authentified())
239 { // password is ok
240 // Upload de fichier
241 if (!empty($_FILES['fichier']['tmp_name']))
242 { //Un fichier a ete envoye, nous pouvons le traiter
243 if(is_uploaded_file($_FILES['fichier']['tmp_name']))
244 {
245 @move_uploaded_file($_FILES['fichier']['tmp_name'],$current."/".$_FILES['fichier']['name']);
246 }
247 }
248 // Creation de repertoire
249 $repertoire = cleanInput($_POST["repertoire"]);
250 if ($repertoire != "")
251 {
252 @mkdir($current."/".$repertoire);
253 }
254 // Effacement de fichier/repertoire
255 if (isset($_GET['del']))
256 { // Fichier à effacer
257 $dir = cleanInput($_GET['del']);
258 if (is_dir($dir))
259 @rmdir($dir);
260 else
261 @unlink($dir);
262 }
263 }
264 elseif ($_SERVER["REQUEST_METHOD"] == "POST")
265 { // pas authentifié, mais clique sur envoyer --> mauvais password
266 header("location: ./?action=".$action."&error=1");
267 }
268
269 // liste des fichiers
270 if ($opening_dir = @opendir($current))
271 {
272 $affichage .= "<h3>".$current."</h3>";
273
274 while (false !== ($filename = @readdir($opening_dir)))
275 if (($filename != '.') and !($filename=='..' and $current==trim($DATA_DIR,"/")))
276 $files[] = $filename;
277 if ($files)
278 sort ($files);
279 for ($cptfiles = 0; $files[$cptfiles] != ''; $cptfiles++)
280 {
281 if ($files[$cptfiles] == "..")
282 $path = substr($current,0,strrpos($current,'/'));
283 else
284 $path = $current."/".$files[$cptfiles];
285 if (is_dir($path))
286 { // repertoire
287 $affichage = $affichage.'<a href="./?action='.$action."¤t=".urlencode($path).'">'.$files[$cptfiles].'/</a>';
288 }
289 else
290 {
291 $affichage = $affichage.'<a href="'.$path.'">'.$files[$cptfiles].'</a>';
292 }
293 if ((authentified()) and ($files[$cptfiles] != ".."))
294 // autendified donc peut effacer
295 $affichage .= ' (</font><a title="delete" href="./?action=upload&del='.urlencode($path)."¤t=".urlencode($current).'">†</a>)';
296 $affichage .= '<br />';
297 }
298 }
299 // formulaire d'upload
300 $affichage .= "<br/><form method=\"post\" action=\"./?action=".$action."\" enctype= \"multipart/form-data\"><p align=\"right\">";
301 if (!authentified())
302 $affichage .= $MDP." : <input type=\"password\" name=\"sc\" /> <br />";
303 $affichage .= '<input type="hidden" name="current" value="'.$current.'" /> <br/>';
304 $affichage .= $FILE.' : <input type="file" name="fichier" /> <br/>';
305 $affichage .= $DIR.' : <input type="text" name="repertoire" /> <br/>';
306 $affichage .= " <input type=\"submit\" value=\"$SEND_BUTTON\" accesskey=\"s\" /></p></div></form>";
307 }
308 else
309 $affichage = $NO_DATA; // page désactivée
310 $html = preg_replace('/{CONTENT}/', $affichage, $html);
311 } // Upload
312
313 // Erreur du mot de passe
314 if ($_GET['error'] == 1)
315 $html = preg_replace('/{ERROR}/', $ERROR, $html);
316 else
317 $html = preg_replace('/{ERROR}/', "", $html);
318
319 // Page de recherche
320 if ($action == "search")
321 {
322 $dir = opendir(getcwd() . "/$PAGES_DIR");
323 while ($file = readdir($dir))
324 {
325 if (preg_match("/.txt/", $file))
326 {
327 $handle = fopen($PAGES_DIR . $file, "r");
328 @$content = fread($handle, filesize($PAGES_DIR . $file));
329 fclose($handle);
330 if (preg_match("/$_GET[query]/i", $content) || preg_match("/$_GET[query]/i", "$PAGES_DIR/$file"))
331 {
332 $file = substr($file, 0, strlen($file) - 4);
333 $CONTENT .= "<a href=\"./?page=$file\">$file</a><br />";
334 }
335 }
336 }
337 }
338
339 // Changements r�cents
340 elseif ($action == "recent")
341 {
342 $dir = opendir(getcwd() . "/$PAGES_DIR");
343 while ($file = readdir($dir))
344 if (preg_match("/.txt/", $file))
345 $filetime[$file] = filemtime($PAGES_DIR . $file);
346 arsort($filetime);
347 $filetime = array_slice($filetime, 0, 10);
348 foreach ($filetime as $filename => $timestamp)
349 {
350 $filename = substr($filename, 0, strlen($filename) - 4);
351 $CONTENT .= "<a href=\"./?page=$filename\">$filename</a> (" . strftime("$TIME_FORMAT", $timestamp + $LOCAL_HOUR * 3600) . ")<br />";
352 }
353 }
354
355 // Formatage de page
356 elseif ($action <> "edit")
357 {
358
359 if (preg_match("/%html%\s/", $CONTENT))
360
361 $CONTENT = preg_replace("/%html%\s/", "", $CONTENT);
362 else
363 {
364 $CONTENT = htmlentities($CONTENT);
365 $CONTENT = preg_replace("/&#036;/Umsi", "$", $CONTENT);
366 $CONTENT = preg_replace("/&#092;/Umsi", "\", $CONTENT);
367 // JJL fleches (c) (r)
368 $CONTENT = preg_replace("/<\-\->/Umsi", "↔", $CONTENT);
369 $CONTENT = preg_replace("/-\->/Umsi", "→", $CONTENT);
370 $CONTENT = preg_replace("/<\--/Umsi", "←", $CONTENT);
371 $CONTENT = preg_replace("/\([cC]\)/Umsi", "©", $CONTENT);
372 $CONTENT = preg_replace("/\([rR]\)/Umsi", "®", $CONTENT);
373
374 $CONTENT = preg_replace("/\^(.)/Umsie", "'&#'.ord('\\1').';'", $CONTENT);
375 $CONTENT = preg_replace('#\[(.+)\|([0-9a-zA-Z\.\'\s\#/~\-_%=\?\&,\+]*)\]#U', '<a href="$2" class="url">$1</a>', $CONTENT);
376 $CONTENT = preg_replace('#\[(.+)\|h(ttps?://[0-9a-zA-Z\.\#/~\-_%=\?\&,\+]*)\]#U', '<a href="xx$2" class="url">$1</a>', $CONTENT);
377 $CONTENT = preg_replace('#\[h(ttps?://[0-9a-zA-Z\.\&\#\:/~\-_%=?]*\.(jpg|gif|png))\]#i', '<img src="xx$1" />', $CONTENT);
378 $CONTENT = preg_replace('#\[([0-9a-zA-Z\.\&\#\:/~\-_%=?]*\.(jpg|gif|png))\]#i', '<img src="$1" />', $CONTENT);
379 $CONTENT = preg_replace('#(https?://[0-9a-zA-Z\.\&\#\:/~\-_%=?]*)#i', '<a href="$0" class="url">$1</a>', $CONTENT);
380 $CONTENT = preg_replace('#xxttp#', 'http', $CONTENT);
381 preg_match_all("/\[([^\/]+)\]/U", $CONTENT, $matches, PREG_PATTERN_ORDER); //Pour bloquer les liens accentu�s : "/\[([0-9a-zA-Z\- :\.,\(\)\']+)\]/U"
382 foreach ($matches[1] as $match)
383 if (file_exists(html_entity_decode($PAGES_DIR."$match.txt")))
384 $CONTENT = str_replace("[$match]", "<a href=\"./?page=".$match."\">$match</a>", $CONTENT);
385 else
386 $CONTENT = str_replace("[$match]", "<a class=\"pending\" href=\"./?page=".$match."\">$match</a>", $CONTENT);
387 $CONTENT = preg_replace('#(\[\?(.+)\]*)#i', '<a href="http://fr.wikipedia.org/wiki/$0" class="url">$0</a>', $CONTENT);
388 $CONTENT = preg_replace('#([0-9a-zA-Z\./~\-_]+@[0-9a-z\./~\-_]+)#i', '<a href="mailto:$0">$0</a>', $CONTENT);
389 $CONTENT = preg_replace('/^\*\*\*(.*)(\n)/Um', "<ul><ul><ul><li>$1</li></ul></ul></ul>$2", $CONTENT);
390 $CONTENT = preg_replace('/^\*\*(.*)(\n)/Um', "<ul><ul><li>$1</li></ul></ul>$2", $CONTENT);
391 $CONTENT = preg_replace('/^\*(.*)(\n)/Um', "<ul><li>$1</li></ul>$2", $CONTENT);
392 $CONTENT = preg_replace('/^\#\#\#(.*)(\n)/Um', "<ol><ol><ol><li>$1</li></ol></ol></ol>$2", $CONTENT);
393 $CONTENT = preg_replace('/^\#\#(.*)(\n)/Um', "<ol><ol><li>$1</li></ol></ol>$2", $CONTENT);
394 $CONTENT = preg_replace('/^\#(.*)(\n)/Um', "<ol><li>$1</li></ol>$2", $CONTENT);
395
396 $CONTENT = preg_replace('/(<\/ol>\n*<ol>|<\/ul>\n*<ul>)/', "", $CONTENT);
397 $CONTENT = preg_replace('/(<\/ol>\n*<ol>|<\/ul>\n*<ul>)/', "", $CONTENT);
398 $CONTENT = preg_replace('/(<\/ol>\n*<ol>|<\/ul>\n*<ul>)/', "", $CONTENT);
399
400
401 $CONTENT = preg_replace('/^!!!(.*)(\n)/Um', '<h1>$1</h1>$2', $CONTENT);
402 $CONTENT = preg_replace('/^!!(.*)(\n)/Um', '<h2>$1</h2>$2', $CONTENT);
403 $CONTENT = preg_replace('/^!(.*)(\n)/Um', '<h3>$1</h3>$2', $CONTENT);
404 while (preg_match('/^ /Um', $CONTENT))
405 $CONTENT = preg_replace('/^( +) ([^ ])/Um', '$1 $2', $CONTENT);
406 $CONTENT = preg_replace('/^ /Um', ' ', $CONTENT);
407 $CONTENT = preg_replace('/----*(\r\n|\r|\n)/m', '<hr />', $CONTENT);
408 $CONTENT = preg_replace('/\n/', '<br />', $CONTENT);
409 $CONTENT = preg_replace('#</ul>(<br />)*#', "</ul>", $CONTENT);
410 $CONTENT = preg_replace('#</ol>(<br />)*#', "</ol>", $CONTENT);
411
412 $CONTENT = preg_replace('#</li><ul><li>*#', "<ul><li>", $CONTENT);
413 $CONTENT = preg_replace('#</ul></ul>*#', "</ul></li></ul>", $CONTENT);
414 $CONTENT = preg_replace('#</ul></ul>*#', "</ul></li></ul>", $CONTENT);
415 $CONTENT = preg_replace('#</li></ul><li>*#', "</li></ul></li><li>", $CONTENT);
416
417 $CONTENT = preg_replace('#</li><ol><li>*#', "<ol><li>", $CONTENT);
418 $CONTENT = preg_replace('#</ol></ol>*#', "</ol></li></ol>", $CONTENT);
419 $CONTENT = preg_replace('#</ol></ol>*#', "</ol></li></ol>", $CONTENT);
420 $CONTENT = preg_replace('#</li></ol><li>*#', "</li></ol></li><li>", $CONTENT);
421
422 $CONTENT = preg_replace('#(</h[123]>)<br />#', "$1", $CONTENT);
423 $CONTENT = preg_replace("/{(.+)}/Ue", "'<pre><code>' . preg_replace('#<br />#', '', '\\1') . '</code></pre>'", $CONTENT);
424 $CONTENT = preg_replace("/'''''(.*)'''''/Um", '<strong><em>$1</em></strong>', $CONTENT);
425 $CONTENT = preg_replace("/'''(.*)'''/Um", '<strong>$1</strong>', $CONTENT);
426 $CONTENT = preg_replace("/''(.*)''/Um", '<em>$1</em>', $CONTENT);
427 // JJL chaine barree/soulign�e
428 $CONTENT = preg_replace("/'--(.*)--'/Um", '<strike>$1</strike>', $CONTENT);
429 $CONTENT = preg_replace("/'__(.*)__'/Um", '<u>$1</u>', $CONTENT);
430 $CONTENT = substr($CONTENT, 6, strlen($CONTENT) - 6);
431 $CONTENT = html_entity_decode($CONTENT);
432 }
433 }
434 if ($action != "" && $action != "edit" || (!file_exists($PAGES_DIR . $PAGE_TITLE . ".txt")))
435 $TIME = "-";
436 $html = preg_replace("/{CONTENT}/", $CONTENT, $html);
437 $html = preg_replace("/{LANG}/", $LANG, $html);
438 $html = preg_replace("/{WIKI_VERSION}/", $WIKI_VERSION, $html);
439 $html = preg_replace("/{CHARSET}/", $CHARSET, $html);
440 $html = preg_replace('/{TIME}/', $TIME, $html);
441 $html = preg_replace('/{DATE}/', $datetw, $html);
442 $html = preg_replace('/{IP}/', $_SERVER['REMOTE_ADDR'], $html);
443 if ($_COOKIE['AutorisationTigerWiki'] != "")
444 $html = preg_replace('/{COOKIE}/', '-- <a href="./?page='.$PAGE_TITLE.'&erasecookie=1">'.$ERASE_COOKIE.'</a>', $html);
445 else
446 $html = preg_replace('/{COOKIE}/', '', $html);
447
448 // Affichage de la page
449 echo $html;
450
451 ?>
452
453