One more permalink patch
This commit is contained in:
@ -5,6 +5,9 @@ Version 1.2 ()
|
|||||||
|
|
||||||
* Introduce '%lowertitle%' permalink attribute to use lowercase
|
* Introduce '%lowertitle%' permalink attribute to use lowercase
|
||||||
permalinks. (garvinhicking)
|
permalinks. (garvinhicking)
|
||||||
|
|
||||||
|
* Allow to call permalinks that end with a "/" the same as if not
|
||||||
|
ending with a "/" (garvinhicking)
|
||||||
|
|
||||||
Version 1.1 ()
|
Version 1.1 ()
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
@ -280,12 +280,10 @@ function &serendipity_permalinkPatterns($return = false) {
|
|||||||
$PAT['ADMIN'] = '@/(' . $serendipity['permalinkAdminPath'] . '|entries)(/.+)?@';
|
$PAT['ADMIN'] = '@/(' . $serendipity['permalinkAdminPath'] . '|entries)(/.+)?@';
|
||||||
$PAT['ARCHIVE'] = '@/' . $serendipity['permalinkArchivePath'] . '/?@';
|
$PAT['ARCHIVE'] = '@/' . $serendipity['permalinkArchivePath'] . '/?@';
|
||||||
$PAT['CATEGORIES'] = '@/' . $serendipity['permalinkCategoriesPath'].'/([0-9;]+)@';
|
$PAT['CATEGORIES'] = '@/' . $serendipity['permalinkCategoriesPath'].'/([0-9;]+)@';
|
||||||
$PAT['PLUGIN'] = '@/(' . $serendipity['permalinkPluginPath'] . '|plugin)/(.*)@';
|
$PAT['PLUGIN'] = '@/(' . $serendipity['permalinkPluginPath'] . '|plugin)/(.*)@';
|
||||||
$PAT['SEARCH'] = '@/' . $serendipity['permalinkSearchPath'] . '/(.*)@';
|
$PAT['SEARCH'] = '@/' . $serendipity['permalinkSearchPath'] . '/(.*)@';
|
||||||
$PAT['COMMENTS'] = '@/' . $serendipity['permalinkCommentsPath'] . '/(.*)@';
|
$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_CATEGORIES'] = '@' . serendipity_makePermalinkRegex($serendipity['permalinkCategoryStructure'], 'category') . '@i';
|
||||||
$PAT['PERMALINK_FEEDCATEGORIES'] = '@' . serendipity_makePermalinkRegex($serendipity['permalinkFeedCategoryStructure'], 'category') . '@i';
|
$PAT['PERMALINK_FEEDCATEGORIES'] = '@' . serendipity_makePermalinkRegex($serendipity['permalinkFeedCategoryStructure'], 'category') . '@i';
|
||||||
$PAT['PERMALINK_FEEDAUTHORS'] = '@' . serendipity_makePermalinkRegex($serendipity['permalinkFeedAuthorStructure'], 'author') . '@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
|
$pq = "SELECT entry_id, data
|
||||||
FROM {$serendipity['dbPrefix']}permalinks
|
FROM {$serendipity['dbPrefix']}permalinks
|
||||||
WHERE (permalink = '" . serendipity_db_escape_string($url) . "'
|
WHERE (permalink = '" . serendipity_db_escape_string($url) . "'
|
||||||
"
|
OR permalink = '" . serendipity_db_escape_string($default) . "')
|
||||||
// PATCH FOR 1.2:
|
|
||||||
// . "OR permalink = '" . serendipity_db_escape_string($default) . "'"
|
|
||||||
. "
|
|
||||||
)
|
|
||||||
AND type = '" . serendipity_db_escape_string($type) . "'
|
AND type = '" . serendipity_db_escape_string($type) . "'
|
||||||
AND entry_id > 0
|
AND entry_id > 0
|
||||||
LIMIT 1";
|
LIMIT 1";
|
||||||
|
Reference in New Issue
Block a user