File tree Expand file tree Collapse file tree 3 files changed +11
-13
lines changed
Expand file tree Collapse file tree 3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 397397 print $ li . 'the credentials in config.php are valid. ' . $ il ;
398398 print $ lu . $ sp ;
399399
400- if (isset ( $ _REQUEST [ 'display_db_errors ' ] ) && !empty ($ config ['DATABASE_ERROR ' ])) { // @phpstan-ignore-line
400+ if (isrv ( 'display_db_errors ' ) && !empty ($ config ['DATABASE_ERROR ' ])) { // @phpstan-ignore-line
401401 print $ ps . 'The following database errors occurred: ' . $ ul ;
402402
403403 foreach ($ config ['DATABASE_ERROR ' ] as $ e ) { // @phpstan-ignore-line
419419 print $ li . 'the credentials in config.php are valid and correct. ' . $ il ;
420420 print $ lu . $ sp ;
421421
422- if (isset ( $ _REQUEST [ 'display_db_errors ' ] ) && !empty ($ config ['DATABASE_ERROR ' ])) { // @phpstan-ignore-line
422+ if (isrv ( 'display_db_errors ' ) && !empty ($ config ['DATABASE_ERROR ' ])) { // @phpstan-ignore-line
423423 print $ ps . 'The following database errors occurred: ' . $ ul ;
424424
425425 foreach ($ config ['DATABASE_ERROR ' ] as $ e ) { // @phpstan-ignore-line
Original file line number Diff line number Diff line change 4444
4545// Repair legacy language support
4646if (!empty ($ config ['i18n_force_language ' ])) {
47- $ _REQUEST [ 'language ' ] = $ config ['i18n_force_language ' ];
47+ set_request_var ( 'language ' , $ config ['i18n_force_language ' ]) ;
4848}
4949
50- if (!empty ( $ _REQUEST [ 'language ' ] )) {
51- $ _REQUEST [ 'language ' ] = repair_locale ($ _REQUEST [ 'language ' ] );
50+ if (!isempty_request_var ( 'language ' )) {
51+ set_request_var ( 'language ' , repair_locale (grv ( 'language ' )) );
5252}
5353
5454// determine whether or not we can support the language
5555$ user_locale = '' ;
5656
57- if (!empty ( $ _REQUEST [ 'language ' ] ) && !empty ($ lang2locale [$ _REQUEST [ 'language ' ] ])) {
57+ if (!isempty_request_var ( 'language ' ) && !empty ($ lang2locale [grv ( 'language ' ) ])) {
5858 // user requests another language
59- $ user_locale = apply_locale ($ _REQUEST [ 'language ' ] );
59+ $ user_locale = apply_locale (grv ( 'language ' ) );
6060 unset($ _SESSION ['sess_current_date1 ' ]);
6161 unset($ _SESSION ['sess_current_date2 ' ]);
6262
Original file line number Diff line number Diff line change 8989 die ('Provider missing ' );
9090}
9191
92- if (!isset ( $ _GET [ 'code ' ] )) { // If we don't have an authorization code then get one
92+ if (!isrv ( 'code ' )) { // If we don't have an authorization code then get one
9393 $ authUrl = $ provider ->getAuthorizationUrl ($ options );
9494 $ _SESSION ['oauth2state ' ] = $ provider ->getState ();
95- header ('Location: ' . $ authUrl );
96-
97- exit ;
95+ cacti_redirect ($ authUrl , false );
9896
9997 // Check given state against previously stored one to mitigate CSRF attack
10098}
10199
102- if (empty ( $ _GET [ 'state ' ] ) || (isset ($ _SESSION ['oauth2state ' ]) && ($ _GET [ 'state ' ] !== $ _SESSION ['oauth2state ' ]))) {
100+ if (isempty_request_var ( 'state ' ) || (isset ($ _SESSION ['oauth2state ' ]) && (grv ( 'state ' ) !== $ _SESSION ['oauth2state ' ]))) {
103101 unset($ _SESSION ['oauth2state ' ]);
104102
105103 exit ('Invalid state ' );
106104} else { // Try to get an access token (using the authorization code grant)
107105 $ token = $ provider ->getAccessToken (
108106 'authorization_code ' ,
109107 [
110- 'code ' => $ _GET [ 'code ' ]
108+ 'code ' => grv ( 'code ' )
111109 ]
112110 );
113111
You can’t perform that action at this time.
0 commit comments