Skip to content

Commit 216dfbb

Browse files
committed
🔨 improve on url() method to return real uri's passed as arguments
Signed-off-by: otengkwame <developerkwame@gmail.com>
1 parent 0ab929b commit 216dfbb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Core/helpers/ci_core_helper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ function app_url($uri = '', $protocol = NULL)
293293
/**
294294
* Improved alias of site_url
295295
*
296-
* @param string $uri
296+
* @param string|array $uri
297297
* @param bool $protocol
298298
* @return string
299299
*/
@@ -303,14 +303,14 @@ function url($uri = '', $param = '', $protocol = null)
303303
return void_url();
304304
}
305305

306-
// Detect if the $uri starts with 'https://' or 'http://'
307-
if (strpos($uri, 'https://') === 0 || strpos($uri, 'http://') === 0) {
308-
return $uri;
306+
// Detect if the $uri is string and starts with 'https://' or 'http://'
307+
if (is_string ($uri) && (strpos($uri, 'https://') === 0 || strpos($uri, 'http://') === 0)) {
308+
return $uri . $param;
309309
}
310310

311311
// Detect if the $uri starts with 'www.'
312-
if (strpos($uri, 'www.') === 0) {
313-
return 'https://' . $uri;
312+
if (is_string ($uri) && strpos($uri, 'www.') === 0) {
313+
return $uri . $param;
314314
}
315315

316316
if (is_array($uri)) {

0 commit comments

Comments
 (0)