[MKDoc-commit] Patch from Sam - updates the link differentiation
code to take into
chris at mkdoc.demon.co.uk
chris at mkdoc.demon.co.uk
Mon Jul 18 11:34:36 BST 2005
Log Message:
-----------
Patch from Sam - updates the link differentiation code to take into
account redirects.
Tags:
----
mkdoc-1-6
Modified Files:
--------------
mkd/MKDoc/Util:
LinkParser.pm
-------------- next part --------------
Index: LinkParser.pm
===================================================================
RCS file: /var/spool/cvs/mkd/MKDoc/Util/Attic/LinkParser.pm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -LMKDoc/Util/LinkParser.pm -LMKDoc/Util/LinkParser.pm -u -r1.1.2.1 -r1.1.2.2
--- MKDoc/Util/LinkParser.pm
+++ MKDoc/Util/LinkParser.pm
@@ -261,6 +261,15 @@
my ($id) = $dbh->selectrow_array('SELECT ID
FROM Document
WHERE Full_Path = ?', undef, $path);
+ return $self->{document_id} = $id if $id;
+
+ # it wasn't in Document, but it might be in Redirect
+ ($id) = $dbh->selectrow_array('SELECT d.ID
+ FROM Document d, Redirect r
+ WHERE d.Full_Path = r.New_Path AND
+ r.Old_Path = ?',
+ undef, $path);
+
return $self->{document_id} = $id ? $id : 0;
}
More information about the MKDoc-commit
mailing list