From 88088f6d0f44cd74c145007cbab7f20b82d534e2 Mon Sep 17 00:00:00 2001 From: cweiske Date: Sat, 16 Jan 2010 08:11:39 +0000 Subject: [PATCH] respect $shorturl configuration setting git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@577 b3834d28-1941-0410-a4f8-b48e95affb8f --- data/config.default.php | 8 ++++++++ www/go.php | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/data/config.default.php b/data/config.default.php index acbb139..69d2c25 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -394,6 +394,14 @@ $useredir = false; */ $url_redir = 'http://www.google.com/url?sa=D&q='; +/** + * Enable short URL service. + * Can be used to visit urls using http://example.org/go/shortname + * + * @var boolean + */ +$shorturl = true; + /** * Array of bookmark extensions that Scuttle should add system tags for. * When adding an URL with one of the given extensions, a system diff --git a/www/go.php b/www/go.php index d306be0..9d1a44f 100644 --- a/www/go.php +++ b/www/go.php @@ -12,6 +12,13 @@ */ require_once '../src/SemanticScuttle/header.php'; +if (!$GLOBALS['shorturl']) { + header('HTTP/1.0 500 Internal Server Error'); + header('Content-Type: text/plain'); + echo 'Short URL service deactivated'; + exit(); +} + if (!isset($_SERVER['PATH_INFO'])) { header('HTTP/1.0 400 Bad Request'); header('Content-Type: text/plain');