mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Add curly braces
This commit is contained in:
@@ -25,11 +25,13 @@ class http_query
|
||||
*/
|
||||
public static function getHttpCodeFromUrl($url)
|
||||
{
|
||||
if ( ! is_scalar($url))
|
||||
if ( ! is_scalar($url)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (trim($url) === '')
|
||||
if (trim($url) === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
@@ -51,11 +53,14 @@ class http_query
|
||||
|
||||
public static function getHttpHeaders($url)
|
||||
{
|
||||
if ( ! is_scalar($url))
|
||||
if ( ! is_scalar($url)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (trim($url) === '')
|
||||
if (trim($url) === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
@@ -82,11 +87,13 @@ class http_query
|
||||
*/
|
||||
public static function getUrl($url, $post_data = false)
|
||||
{
|
||||
if ( ! is_scalar($url))
|
||||
if ( ! is_scalar($url)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (trim($url) === '')
|
||||
if (trim($url) === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
|
@@ -87,8 +87,10 @@ class http_request
|
||||
public function is_ajax()
|
||||
{
|
||||
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
|
||||
strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
|
||||
strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user