Replace x() by isset(), !empty() or defaults()
- Remove extraneous parentheses around empty() calls - Remove duplicate calls to intval(), count() or strlen() after empty() - Replace ternary operators outputting binary value with empty() return value - Rewrite defaults() without x()
This commit is contained in:
@@ -47,8 +47,8 @@ function parse_url_content(App $a)
|
||||
|
||||
// Add url scheme if it is missing
|
||||
$arrurl = parse_url($url);
|
||||
if (!x($arrurl, 'scheme')) {
|
||||
if (x($arrurl, 'host')) {
|
||||
if (empty($arrurl['scheme'])) {
|
||||
if (!empty($arrurl['host'])) {
|
||||
$url = 'http:' . $url;
|
||||
} else {
|
||||
$url = 'http://' . $url;
|
||||
|
||||
Reference in New Issue
Block a user