From 93d088f62b528644174f25420b87902907532440 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Fri, 5 Feb 2016 19:59:15 -0800 Subject: [PATCH] Replace equal comparison operators with identical comparison operators --- examples/flickr.class.php | 2 +- examples/gmail_send_email.php | 4 ++-- examples/google_plus_profile.php | 4 ++-- examples/instagram_popular_media.php | 2 +- tests/PHPCurlClass/server.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/flickr.class.php b/examples/flickr.class.php index e815b08..285ca7d 100644 --- a/examples/flickr.class.php +++ b/examples/flickr.class.php @@ -74,7 +74,7 @@ class Flickr { $oauth_data = $this->getOAuthParameters(); $oauth_data['oauth_callback'] = implode('', array( - isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http', + isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http', '://', $_SERVER['SERVER_NAME'], $_SERVER['SCRIPT_NAME'], diff --git a/examples/gmail_send_email.php b/examples/gmail_send_email.php index 3fdbfb5..e5a42d4 100644 --- a/examples/gmail_send_email.php +++ b/examples/gmail_send_email.php @@ -18,7 +18,7 @@ if (isset($_GET['code'])) { 'client_id' => CLIENT_ID, 'client_secret' => CLIENT_SECRET, 'redirect_uri' => implode('', array( - isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http', + isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http', '://', $_SERVER['SERVER_NAME'], $_SERVER['SCRIPT_NAME'], @@ -65,7 +65,7 @@ if (isset($_GET['code'])) { $curl->get('https://accounts.google.com/o/oauth2/auth', array( 'scope' => 'https://www.googleapis.com/auth/gmail.compose', 'redirect_uri' => implode('', array( - isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http', + isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http', '://', $_SERVER['SERVER_NAME'], $_SERVER['SCRIPT_NAME'], diff --git a/examples/google_plus_profile.php b/examples/google_plus_profile.php index dea0c47..7536f39 100644 --- a/examples/google_plus_profile.php +++ b/examples/google_plus_profile.php @@ -18,7 +18,7 @@ if (isset($_GET['code'])) { 'client_id' => CLIENT_ID, 'client_secret' => CLIENT_SECRET, 'redirect_uri' => implode('', array( - isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http', + isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http', '://', $_SERVER['SERVER_NAME'], $_SERVER['SCRIPT_NAME'], @@ -52,7 +52,7 @@ if (isset($_GET['code'])) { $curl->get('https://accounts.google.com/o/oauth2/auth', array( 'scope' => 'https://www.googleapis.com/auth/plus.me', 'redirect_uri' => implode('', array( - isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http', + isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http', '://', $_SERVER['SERVER_NAME'], $_SERVER['SCRIPT_NAME'], diff --git a/examples/instagram_popular_media.php b/examples/instagram_popular_media.php index a29e6d5..4beef4f 100644 --- a/examples/instagram_popular_media.php +++ b/examples/instagram_popular_media.php @@ -9,7 +9,7 @@ define('INSTAGRAM_CLIENT_SECRET', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'); session_start(); $redirect_uri = implode('', array( - isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http', + isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http', '://', $_SERVER['SERVER_NAME'], $_SERVER['SCRIPT_NAME'], diff --git a/tests/PHPCurlClass/server.php b/tests/PHPCurlClass/server.php index f69235a..d490c3a 100644 --- a/tests/PHPCurlClass/server.php +++ b/tests/PHPCurlClass/server.php @@ -36,7 +36,7 @@ if ($request_method === 'POST') { $test = isset($_SERVER['HTTP_X_DEBUG_TEST']) ? $_SERVER['HTTP_X_DEBUG_TEST'] : ''; $key = isset($data_values['key']) ? $data_values['key'] : ''; -if ($test == 'http_basic_auth') { +if ($test === 'http_basic_auth') { if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); @@ -50,7 +50,7 @@ if ($test == 'http_basic_auth') { 'password' => $_SERVER['PHP_AUTH_PW'], )); exit; -} elseif ($test == 'http_digest_auth') { +} elseif ($test === 'http_digest_auth') { $users = array( 'myusername' => 'mypassword', );