Allow ?p=X and ?serendipity[id]=X URLs

This commit is contained in:
Garvin Hicking 2007-08-28 07:56:36 +00:00
parent 612ef7e39d
commit e634186dcc
2 changed files with 13 additions and 2 deletions

View File

@ -3,6 +3,9 @@
Version 1.3 ()
------------------------------------------------------------------------
* Made short-urls index.php?serendipity[id]=X or index.php?p=X
properly show a single entry view (garvinhicking)
* Extended spam blocking plugin to handle pingbacks like trackbacks.
(brockhaus)

View File

@ -250,10 +250,18 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
echo $data;
} else if ( preg_match(PAT_COMMENTSUB, $uri, $matches) ||
preg_match(PAT_PERMALINK, $uri, $matches) ) {
preg_match(PAT_PERMALINK, $uri, $matches) ||
isset($serendipity['GET']['id']) ||
isset($_GET['p']) ) {
$serendipity['view'] = 'entry';
$matches[1] = serendipity_searchPermalink($serendipity['permalinkStructure'], $uri, (!empty($matches[2]) ? $matches[2] : $matches[1]), 'entry');
if (isset($serendipity['GET']['id'])) {
$matches[1] = (int)$serendipity['GET']['id'];
} elseif (isset($_GET['p'])) {
$matches[1] = $_GET['p'];
} else {
$matches[1] = serendipity_searchPermalink($serendipity['permalinkStructure'], $uri, (!empty($matches[2]) ? $matches[2] : $matches[1]), 'entry');
}
serendipity_rememberComment();
if (!empty($serendipity['POST']['submit']) && !isset($_REQUEST['serendipity']['csuccess'])) {