File tree Expand file tree Collapse file tree 6 files changed +15
-8
lines changed Expand file tree Collapse file tree 6 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ private function getRequestToken()
74
74
{
75
75
$ oauth_data = $ this ->getOAuthParameters ();
76
76
$ oauth_data ['oauth_callback ' ] = implode ('' , array (
77
- isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] == 'on ' ? 'https ' : 'http ' ,
77
+ isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] === 'on ' ? 'https ' : 'http ' ,
78
78
':// ' ,
79
79
$ _SERVER ['SERVER_NAME ' ],
80
80
$ _SERVER ['SCRIPT_NAME ' ],
Original file line number Diff line number Diff line change 18
18
'client_id ' => CLIENT_ID ,
19
19
'client_secret ' => CLIENT_SECRET ,
20
20
'redirect_uri ' => implode ('' , array (
21
- isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] == 'on ' ? 'https ' : 'http ' ,
21
+ isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] === 'on ' ? 'https ' : 'http ' ,
22
22
':// ' ,
23
23
$ _SERVER ['SERVER_NAME ' ],
24
24
$ _SERVER ['SCRIPT_NAME ' ],
65
65
$ curl ->get ('https://accounts.google.com/o/oauth2/auth ' , array (
66
66
'scope ' => 'https://www.googleapis.com/auth/gmail.compose ' ,
67
67
'redirect_uri ' => implode ('' , array (
68
- isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] == 'on ' ? 'https ' : 'http ' ,
68
+ isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] === 'on ' ? 'https ' : 'http ' ,
69
69
':// ' ,
70
70
$ _SERVER ['SERVER_NAME ' ],
71
71
$ _SERVER ['SCRIPT_NAME ' ],
Original file line number Diff line number Diff line change 18
18
'client_id ' => CLIENT_ID ,
19
19
'client_secret ' => CLIENT_SECRET ,
20
20
'redirect_uri ' => implode ('' , array (
21
- isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] == 'on ' ? 'https ' : 'http ' ,
21
+ isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] === 'on ' ? 'https ' : 'http ' ,
22
22
':// ' ,
23
23
$ _SERVER ['SERVER_NAME ' ],
24
24
$ _SERVER ['SCRIPT_NAME ' ],
52
52
$ curl ->get ('https://accounts.google.com/o/oauth2/auth ' , array (
53
53
'scope ' => 'https://www.googleapis.com/auth/plus.me ' ,
54
54
'redirect_uri ' => implode ('' , array (
55
- isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] == 'on ' ? 'https ' : 'http ' ,
55
+ isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] === 'on ' ? 'https ' : 'http ' ,
56
56
':// ' ,
57
57
$ _SERVER ['SERVER_NAME ' ],
58
58
$ _SERVER ['SCRIPT_NAME ' ],
Original file line number Diff line number Diff line change 9
9
session_start ();
10
10
11
11
$ redirect_uri = implode ('' , array (
12
- isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] == 'on ' ? 'https ' : 'http ' ,
12
+ isset ($ _SERVER ['HTTPS ' ]) && $ _SERVER ['HTTPS ' ] === 'on ' ? 'https ' : 'http ' ,
13
13
':// ' ,
14
14
$ _SERVER ['SERVER_NAME ' ],
15
15
$ _SERVER ['SCRIPT_NAME ' ],
Original file line number Diff line number Diff line change 36
36
$ test = isset ($ _SERVER ['HTTP_X_DEBUG_TEST ' ]) ? $ _SERVER ['HTTP_X_DEBUG_TEST ' ] : '' ;
37
37
$ key = isset ($ data_values ['key ' ]) ? $ data_values ['key ' ] : '' ;
38
38
39
- if ($ test == 'http_basic_auth ' ) {
39
+ if ($ test === 'http_basic_auth ' ) {
40
40
if (!isset ($ _SERVER ['PHP_AUTH_USER ' ])) {
41
41
header ('WWW-Authenticate: Basic realm="My Realm" ' );
42
42
header ('HTTP/1.0 401 Unauthorized ' );
50
50
'password ' => $ _SERVER ['PHP_AUTH_PW ' ],
51
51
));
52
52
exit ;
53
- } elseif ($ test == 'http_digest_auth ' ) {
53
+ } elseif ($ test === 'http_digest_auth ' ) {
54
54
$ users = array (
55
55
'myusername ' => 'mypassword ' ,
56
56
);
Original file line number Diff line number Diff line change @@ -84,3 +84,10 @@ if [[ ! -z "${caps}" ]]; then
84
84
echo -e " ${caps} " | perl -pe ' s/^(.*)$/All caps found in \1/'
85
85
exit 1
86
86
fi
87
+
88
+ # Require identical comparison operators (===, not ==) in php files.
89
+ equal=$( find . -type " f" -iname " *.php" ! -path " */vendor/*" -exec egrep --color=always --line-number -H " [^!=]==[^=]" {} \; )
90
+ if [[ ! -z " ${equal} " ]]; then
91
+ echo -e " ${equal} " | perl -pe ' s/^(.*)$/Non-identical comparison operator found in \1/'
92
+ exit 1
93
+ fi
You can’t perform that action at this time.
0 commit comments