]> git.mjollnir.org Git - s9y.git/commitdiff
One more permalink patch
authorgarvinhicking <garvinhicking>
Wed, 6 Dec 2006 14:59:11 +0000 (14:59 +0000)
committergarvinhicking <garvinhicking>
Wed, 6 Dec 2006 14:59:11 +0000 (14:59 +0000)
docs/NEWS
include/functions_permalinks.inc.php

index 7b33c57a36062761fe17992616a15c2567effebf..8828749d9a525b2e2d1a97d4e954a250832dad02 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -5,6 +5,9 @@ Version 1.2 ()
 
     * Introduce '%lowertitle%' permalink attribute to use lowercase
       permalinks. (garvinhicking)
+    
+    * Allow to call permalinks that end with a "/" the same as if not
+      ending with a "/" (garvinhicking)
 
 Version 1.1 ()
 ------------------------------------------------------------------------
index 1aa254682ab53ca022dfef0cbdbf7a46ba50167d..b507e1a863d7248a5955abed22e82c92033f2841 100644 (file)
@@ -280,12 +280,10 @@ function &serendipity_permalinkPatterns($return = false) {
     $PAT['ADMIN']                    = '@/(' . $serendipity['permalinkAdminPath'] . '|entries)(/.+)?@';
     $PAT['ARCHIVE']                  = '@/'  . $serendipity['permalinkArchivePath'] . '/?@';
     $PAT['CATEGORIES']               = '@/'  . $serendipity['permalinkCategoriesPath'].'/([0-9;]+)@';
-    $PAT['PLUGIN']                   = '@/('  . $serendipity['permalinkPluginPath'] . '|plugin)/(.*)@';
+    $PAT['PLUGIN']                   = '@/(' . $serendipity['permalinkPluginPath'] . '|plugin)/(.*)@';
     $PAT['SEARCH']                   = '@/'  . $serendipity['permalinkSearchPath'] . '/(.*)@';
     $PAT['COMMENTS']                 = '@/'  . $serendipity['permalinkCommentsPath'] . '/(.*)@';
-    // PATCH FOR UPCOMING 1.2:
-    // $PAT['PERMALINK']             = '@('   . serendipity_makePermalinkRegex($serendipity['permalinkStructure'], 'entry') . ')/?@i';
-    $PAT['PERMALINK']                = '@'   . serendipity_makePermalinkRegex($serendipity['permalinkStructure'], 'entry') . '@i';
+    $PAT['PERMALINK']                = '@('  . serendipity_makePermalinkRegex($serendipity['permalinkStructure'], 'entry') . ')/?@i';
     $PAT['PERMALINK_CATEGORIES']     = '@'   . serendipity_makePermalinkRegex($serendipity['permalinkCategoryStructure'], 'category') . '@i';
     $PAT['PERMALINK_FEEDCATEGORIES'] = '@'   . serendipity_makePermalinkRegex($serendipity['permalinkFeedCategoryStructure'], 'category') . '@i';
     $PAT['PERMALINK_FEEDAUTHORS']    = '@'   . serendipity_makePermalinkRegex($serendipity['permalinkFeedAuthorStructure'], 'author') . '@i';
@@ -325,11 +323,7 @@ function serendipity_searchPermalink($struct, $url, $default, $type = 'entry') {
         $pq = "SELECT entry_id, data
                  FROM {$serendipity['dbPrefix']}permalinks
                 WHERE (permalink = '" . serendipity_db_escape_string($url) . "'
-                       "
-                       // PATCH FOR 1.2:
-                       // . "OR permalink = '" . serendipity_db_escape_string($default) . "'"
-                       . "
-                      )
+                   OR permalink = '" . serendipity_db_escape_string($default) . "')
                   AND type      = '" . serendipity_db_escape_string($type) . "'
                   AND entry_id  > 0
                 LIMIT 1";