diff --git a/inc/class.kutrl.php b/inc/class.kutrl.php index b227a66..209f8c5 100644 --- a/inc/class.kutrl.php +++ b/inc/class.kutrl.php @@ -25,7 +25,7 @@ class kUtRL if (empty($list)) { return []; } - $service = []; + $services = []; foreach($list as $k => $callback) { try { list($service_id,$service_class) = call_user_func($callback); diff --git a/inc/index.link.php b/inc/index.link.php index 1283dc9..fa74c5a 100644 --- a/inc/index.link.php +++ b/inc/index.link.php @@ -118,7 +118,7 @@ if (null === $kut) { form::field('custom', 50, 32, '') . '

' . '

' . __('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; }