OSDN Git Service

BugTrack2/167: The *.ref file should not be deleted when references by autolink only.
authorteanan <teanan>
Wed, 5 Apr 2006 17:20:47 +0000 (02:20 +0900)
committerteanan <teanan>
Wed, 5 Apr 2006 17:20:47 +0000 (02:20 +0900)
lib/link.php

index 0c9b3e2..1410f49 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 // PukiWiki - Yet another WikiWikiWeb clone
-// $Id: link.php,v 1.9 2006/01/12 08:49:54 teanan Exp $
-// Copyright (C) 2003-2005 PukiWiki Developers Team
+// $Id: link.php,v 1.10 2006/04/05 17:20:47 teanan Exp $
+// Copyright (C) 2003-2006 PukiWiki Developers Team
 // License: GPL v2 or (at your option) any later version
 //
 // Backlinks / AutoLinks related functions
@@ -214,19 +214,15 @@ function links_delete($page, $del)
                $ref_file = CACHE_DIR . encode($_page) . '.ref';
                if (! file_exists($ref_file)) continue;
 
-               $all_auto = TRUE;
                $is_page = is_page($_page);
 
                $ref = '';
                foreach (file($ref_file) as $line) {
                        list($ref_page, $ref_auto) = explode("\t", rtrim($line));
-                       if ($ref_page != $page) {
-                               if (! $ref_auto) $all_auto = FALSE;
-                               $ref .= $line;
-                       }
+                       if ($ref_page != $page) $ref .= $line;
                }
                unlink($ref_file);
-               if ($is_page && ! $all_auto && $ref != '') {
+               if ($is_page && $ref != '') {
                        $fp = fopen($ref_file, 'w')
                                or die_message('cannot write ' . htmlspecialchars($ref_file));
                        fputs($fp, $ref);