1
0

* Change uriArgument parsing routine to allow "!" in URLs.

Now we can have absolute serocracy.
This commit is contained in:
Garvin Hicking
2009-05-28 08:34:52 +00:00
parent 876a15980b
commit be0bdd9cf6
4 changed files with 11 additions and 2 deletions

View File

@ -3,6 +3,9 @@
Version 1.5 () Version 1.5 ()
------------------------------------------------------------------------ ------------------------------------------------------------------------
* Change uriArgument parsing routine to allow "!" in URLs.
Now we can have absolute serocracy.
* Changed image upload workflow so that the upload results/errors * Changed image upload workflow so that the upload results/errors
are shown on top of the media library, allowing to go on are shown on top of the media library, allowing to go on
immediately (onli) immediately (onli)

View File

@ -777,7 +777,7 @@ static $indexFile = null;
} }
/* Explode the path into sections, to later be able to check for arguments and add our own */ /* Explode the path into sections, to later be able to check for arguments and add our own */
preg_match('/^'. preg_quote($serendipity['serendipityHTTPPath'], '/') . '(' . preg_quote($serendipity['indexFile'], '/') . '\?\/)?(' . ($wildcard ? '.+' : '[;,_a-z0-9\-*\/%\+]+') . ')/i', $uri, $_res); preg_match('/^'. preg_quote($serendipity['serendipityHTTPPath'], '/') . '(' . preg_quote($serendipity['indexFile'], '/') . '\?\/)?(' . ($wildcard ? '.+' : '[!;,_a-z0-9\-*\/%\+]+') . ')/i', $uri, $_res);
if (strlen($_res[2]) != 0) { if (strlen($_res[2]) != 0) {
$args = explode('/', $_res[2]); $args = explode('/', $_res[2]);
if ($args[0] == $indexFile || $args[0] == $serendipity['indexFile']) { if ($args[0] == $indexFile || $args[0] == $serendipity['indexFile']) {

View File

@ -21,7 +21,8 @@ if (!defined('S9Y_FRAMEWORK_PLUGIN_INTERNAL')) {
$uri_addData = array( $uri_addData = array(
'startpage' => false, 'startpage' => false,
'uriargs' => implode('/', serendipity_getUriArguments($uri, true)), 'uriargs' => implode('/', serendipity_getUriArguments($uri, true)),
'view' => $serendipity['view'] 'view' => $serendipity['view'],
'viewtype' => $serendipity['viewtype']
); );
if ((empty($uri_addData['uriargs']) || trim($uri_addData['uriargs']) == $serendipity['indexFile']) && empty($serendipity['GET']['subpage'])) { if ((empty($uri_addData['uriargs']) || trim($uri_addData['uriargs']) == $serendipity['indexFile']) && empty($serendipity['GET']['subpage'])) {
$uri_addData['startpage'] = true; $uri_addData['startpage'] = true;

View File

@ -307,6 +307,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
$serendipity['head_subtitle'] = htmlspecialchars($serendipity['blogTitle']); $serendipity['head_subtitle'] = htmlspecialchars($serendipity['blogTitle']);
} else { } else {
$serendipity['view'] = '404'; $serendipity['view'] = '404';
$serendipity['viewtype'] = '404_1';
header('HTTP/1.0 404 Not found'); header('HTTP/1.0 404 Not found');
header('Status: 404 Not found'); header('Status: 404 Not found');
} }
@ -449,6 +450,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
if (!is_array($cInfo)) { if (!is_array($cInfo)) {
$serendipity['view'] = '404'; $serendipity['view'] = '404';
$serendipity['viewtype'] = '404_2';
header('HTTP/1.0 404 Not found'); header('HTTP/1.0 404 Not found');
header('Status: 404 Not found'); header('Status: 404 Not found');
} else { } else {
@ -495,6 +497,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
if (!is_array($uInfo)) { if (!is_array($uInfo)) {
$serendipity['view'] = '404'; $serendipity['view'] = '404';
$serendipity['viewtype'] = '404_3';
header('HTTP/1.0 404 Not found'); header('HTTP/1.0 404 Not found');
header('Status: 404 Not found'); header('Status: 404 Not found');
} else { } else {
@ -608,6 +611,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
} else { } else {
$serendipity['view'] = '404'; $serendipity['view'] = '404';
$serendipity['viewtype'] = '404_4';
header('HTTP/1.0 404 Not found'); header('HTTP/1.0 404 Not found');
header('Status: 404 Not found'); header('Status: 404 Not found');
include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
@ -624,6 +628,7 @@ if (!defined('NO_EXIT')) {
$serendipity['smarty']->assign_by_ref('raw_data', $raw_data); $serendipity['smarty']->assign_by_ref('raw_data', $raw_data);
if (empty($serendipity['smarty_file'])) { if (empty($serendipity['smarty_file'])) {
$serendipity['smarty_file'] = '404.tpl'; $serendipity['smarty_file'] = '404.tpl';
$serendipity['viewtype'] = '404_5';
} }
serendipity_gzCompression(); serendipity_gzCompression();