From 2acf82b4e00579d8609333790057e210d89a5dc8 Mon Sep 17 00:00:00 2001
From: Jean-Christian Denis
' . __('Only if you want a custom short link.') . '
'; - if ($s_admin_service == 'local') { + if ($kut->admin_service == 'local') { echo '' . __('You can use "bob!!" if you want a semi-custom link, it starts with "bob" and "!!" will be replaced by an increment value.') . '
'; diff --git a/inc/lib.kutrl.srv.php b/inc/lib.kutrl.srv.php index c529e81..7cd92d1 100644 --- a/inc/lib.kutrl.srv.php +++ b/inc/lib.kutrl.srv.php @@ -57,6 +57,12 @@ class kutrlService # Magic get for config values public function __get($k) + { + return $this->get($k); + } + + # get config value + public function get($k) { return isset($this->config[$k]) ? $this->config[$k] : null; } @@ -103,7 +109,7 @@ class kutrlService # Test if an url is long enoutgh public function isLongerUrl($url) { - return ((integer) $this->url_min_len >= $url); + return (strlen($url) >= (integer) $this->url_min_len); } # Test if an url protocol (eg: http://) is allowed diff --git a/inc/services/class.local.service.php b/inc/services/class.local.service.php index 6334a32..7354b91 100644 --- a/inc/services/class.local.service.php +++ b/inc/services/class.local.service.php @@ -100,7 +100,8 @@ class localKutrlService extends kutrlService public function testService() { - if (!empty($this->allow_protocols)) + $ap = $this->allow_protocols; + if (!empty($ap)) { return true; }