From 5139d5a1d2093526960269bd35e08e7a599dc1c2 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 13 Jun 2007 01:18:03 +0000 Subject: [PATCH] Fix problem with absolutely resolved relative paths for pages that were in the document root. git-svn-id: http://htmlpurifier.org/svnroot@1138 48356398-32a2-884e-a903-53898d9a118a --- XHTMLCompiler/DOMFilter/AbsolutePath.php | 2 ++ smoketests/DOMFilter/AbsolutePath.xhtml | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/XHTMLCompiler/DOMFilter/AbsolutePath.php b/XHTMLCompiler/DOMFilter/AbsolutePath.php index 419a9ee..59cd73c 100644 --- a/XHTMLCompiler/DOMFilter/AbsolutePath.php +++ b/XHTMLCompiler/DOMFilter/AbsolutePath.php @@ -29,6 +29,8 @@ class XHTMLCompiler_DOMFilter_AbsolutePath extends XHTMLCompiler_DOMFilter // to absolute form, we can extend the syntax to allow // multiple attributes. $uri = $node->getAttribute($attribute); + // special cases + if ($uri == '.' && $prefix) $uri = ''; $node->setAttribute($attribute, $prefix . $uri); } } diff --git a/smoketests/DOMFilter/AbsolutePath.xhtml b/smoketests/DOMFilter/AbsolutePath.xhtml index b432442..d53d809 100644 --- a/smoketests/DOMFilter/AbsolutePath.xhtml +++ b/smoketests/DOMFilter/AbsolutePath.xhtml @@ -8,9 +8,9 @@

DOMFilter/AbsolutePath.html

-

Regular link

-

Absolute link

-

Expect: First links goes to this page, second link goes to - relative document root.

+

Regular link to this directory

+

Regular link to this page

+

Absolute link to document root

+

Absolute link to document root (don't use this syntax though)

\ No newline at end of file -- 2.11.4.GIT