From fca09880bc39d2814492cee6197a76f12e715d91 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 7 Feb 2017 16:11:32 +0100 Subject: textbook ternary --- it_url.class | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'it_url.class') diff --git a/it_url.class b/it_url.class index b78aa0f..e9d3c45 100644 --- a/it_url.class +++ b/it_url.class @@ -189,10 +189,7 @@ function request($p=array()) if ($fp = @fsockopen($url->realhostname, $url->port, $dummy_errno, $errstr, $p['timeout'])) { # urlencode data pairs if is array - if (is_array($p['data'])) - $data = it_url::params($p['data']); - else - $data = $p['data']; + $data = is_array($p['data']) ? it_url::params($p['data']) : $p['data']; $p['headers'] = (array)$p['headers'] + self::_default_headers($url, $p); -- cgit v1.2.3