diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/router.php | 4 | ||||
-rw-r--r-- | lib/util.php | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/router.php b/lib/router.php index 0dd130ab0..64853e419 100644 --- a/lib/router.php +++ b/lib/router.php @@ -580,6 +580,10 @@ class Router $m->connect('api/search.json', array('action' => 'twitapisearchjson')); $m->connect('api/trends.json', array('action' => 'twitapitrends')); + $m->connect('getfile/:filename', + array('action' => 'getfile'), + array('filename' => '[A-Za-z0-9._-]+')); + // user stuff foreach (array('subscriptions', 'subscribers', diff --git a/lib/util.php b/lib/util.php index b6e89f0bd..d159c583e 100644 --- a/lib/util.php +++ b/lib/util.php @@ -781,12 +781,18 @@ function common_path($relative, $ssl=false) if (is_string(common_config('site', 'sslserver')) && mb_strlen(common_config('site', 'sslserver')) > 0) { $serverpart = common_config('site', 'sslserver'); - } else { + } else if (common_config('site', 'server')) { $serverpart = common_config('site', 'server'); + } else { + common_log(LOG_ERR, 'Site Sever not configured, unable to determine site name.'); } } else { $proto = 'http'; - $serverpart = common_config('site', 'server'); + if (common_config('site', 'server')) { + $serverpart = common_config('site', 'server'); + } else { + common_log(LOG_ERR, 'Site Sever not configured, unable to determine site name.'); + } } return $proto.'://'.$serverpart.'/'.$pathpart.$relative; |