From e146d20db6e7de26585ae1a796b0ef0bb6ad24ec Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sun, 18 May 2008 17:14:03 +0000 Subject: [PATCH] Add warnings when people attempt to download deprecated versions. - PEAR to PEAR - Make htaccess.php check the conf/ directory git-svn-id: http://htmlpurifier.org/svnroot@1731 48356398-32a2-884e-a903-53898d9a118a --- .htaccess.in | 8 ++++ download.xhtml | 2 +- release.txt | 2 + releases/.htaccess | 1 + releases/warning.xhtml | 61 +++++++++++++++++++++++++ xhtml-compiler/htaccess.php | 1 + xhtml-compiler/tests/XHTMLCompiler/FileTest.php | 2 +- 7 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 releases/warning.xhtml diff --git a/.htaccess.in b/.htaccess.in index 9d55005..3c1763b 100644 --- a/.htaccess.in +++ b/.htaccess.in @@ -1 +1,9 @@ # HERE xhtml-compiler/main.php mod_rewrite + +# Old release warning rewrites +RewriteCond %{REQUEST_METHOD} !=POST +RewriteCond %{REQUEST_URI} !/htmlpurifier-3\.1\.0rc1(\.|-standalone|-lite) +RewriteCond %{REQUEST_URI} !/htmlpurifier-2\.1\.3(\.|-standalone|-lite|-strict) +RewriteCond %{REQUEST_URI} !/phorum-htmlpurifier-3\.0\.0\. +RewriteCond %{REQUEST_URI} !\.sig$ +RewriteRule ^releases/(htmlpurifier-|phorum-) releases/warning.html [N] diff --git a/download.xhtml b/download.xhtml index b588977..1e6ebf9 100644 --- a/download.xhtml +++ b/download.xhtml @@ -304,7 +304,7 @@ pear install hp/HTMLPurifier ?>

- People with HTML Purifier already in their path (PEAR, + People with HTML Purifier already in their path (PEAR, for example) can use:

diff --git a/release.txt b/release.txt index ba9252f..2fa01c2 100644 --- a/release.txt +++ b/release.txt @@ -43,8 +43,10 @@ if ( need to deprecate old branch ) { - current.ent . Bump version number and date - Switch the external for live/ + - Update .htaccess.in # Update (svn update) # Commit (svn commit) +# Run http://htmlpurifier.org/xhtml-compiler/htaccess.php == Post-procedures == diff --git a/releases/.htaccess b/releases/.htaccess index 4559bd6..27ca4ad 100644 --- a/releases/.htaccess +++ b/releases/.htaccess @@ -1,3 +1,4 @@ IndexOptions +VersionSort +XHTML +SuppressHTMLPreamble -FancyIndexing -HTMLTable IndexOrderDefault Descending Name IndexIgnore *.bat *.sh +Header append Cache-Control "no-cache, must-revalidate" diff --git a/releases/warning.xhtml b/releases/warning.xhtml new file mode 100644 index 0000000..e41f05a --- /dev/null +++ b/releases/warning.xhtml @@ -0,0 +1,61 @@ + + + + + Deprecated version warning - HTML Purifier + + + + + + + +

Deprecated version warning

+ +
+ +

+ You have attempted to download a deprecated version of a file published + by HTML Purifier (usually the HTML Purifier library itself). While + we keep these versions publically available through this releases/ + directory as well as the + Subversion repository, + usage of these old versions is strongly discouraged, as they are + unsupported and may contain critical bugs or security problems. +

+ +

But I need the older version!

+ +

+ If you were pointed here via a link from another website, you may + be interested in our downloads page, + which contains links to the most recent versions of HTML Purifier. +

+ +

+ If there is an incompatibility between your code and the more recent version, + please post your issues in the forums and we + will try to help you out as best we can. +

+ +

Download

+ +
+

+ I understand the risks of using an older version and still wish to download.
+ +

+
+ +

+ To use wget, add the --post-data="" flag to your command. +

+ +
+ + + diff --git a/xhtml-compiler/htaccess.php b/xhtml-compiler/htaccess.php index b8ce184..74c9755 100644 --- a/xhtml-compiler/htaccess.php +++ b/xhtml-compiler/htaccess.php @@ -24,6 +24,7 @@ if (file_exists('.htaccess')) { 'xhtml-compiler/config.php', 'xhtml-compiler/config.default.php', 'xhtml-compiler/config.smoketest.php', + 'xhtml-compiler/conf/config.php', 'xhtml-compiler/htaccess.php', 'redirects.txt', ); diff --git a/xhtml-compiler/tests/XHTMLCompiler/FileTest.php b/xhtml-compiler/tests/XHTMLCompiler/FileTest.php index 884e36e..852015d 100644 --- a/xhtml-compiler/tests/XHTMLCompiler/FileTest.php +++ b/xhtml-compiler/tests/XHTMLCompiler/FileTest.php @@ -16,8 +16,8 @@ class XHTMLCompiler_FileTest extends XHTMLCompiler_FileSystemHarness function testGetNonExistent() { $name = 'notfound.txt'; - $file = new XHTMLCompiler_File($name); $this->expectError(); + $file = new XHTMLCompiler_File($name); $this->assertFalse($file->get()); } -- 2.11.4.GIT