@@ -184,40 +184,40 @@ |
||
| 184 | 184 | return; |
| 185 | 185 | } |
| 186 | 186 | switch ($_GET['response_type']) { |
| 187 | - case 'code': |
|
| 188 | - $Response->redirect( |
|
| 189 | - http_build_url( |
|
| 190 | - $redirect_uri, |
|
| 191 | - [ |
|
| 192 | - 'code' => $code, |
|
| 193 | - 'state' => isset($_GET['state']) ? $_GET['state'] : false |
|
| 194 | - ] |
|
| 195 | - ), |
|
| 196 | - 302 |
|
| 197 | - ); |
|
| 198 | - $Page->Content = ''; |
|
| 199 | - return; |
|
| 200 | - case 'token': |
|
| 201 | - $token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], $redirect_uri); |
|
| 202 | - if ($token_data) { |
|
| 203 | - unset($token_data['refresh_token']); |
|
| 204 | - $url = http_build_url( |
|
| 205 | - $redirect_uri, |
|
| 206 | - array_merge( |
|
| 207 | - $token_data, |
|
| 187 | + case 'code': |
|
| 188 | + $Response->redirect( |
|
| 189 | + http_build_url( |
|
| 190 | + $redirect_uri, |
|
| 208 | 191 | [ |
| 192 | + 'code' => $code, |
|
| 209 | 193 | 'state' => isset($_GET['state']) ? $_GET['state'] : false |
| 210 | 194 | ] |
| 211 | - ) |
|
| 195 | + ), |
|
| 196 | + 302 |
|
| 212 | 197 | ); |
| 213 | - $url = implode('#', explode('?', $url, 2)); |
|
| 214 | - $Response->redirect($url, 302); |
|
| 215 | 198 | $Page->Content = ''; |
| 216 | 199 | return; |
| 217 | - } else { |
|
| 218 | - error_redirect('server_error', "Server can't get token data, try later"); |
|
| 219 | - return; |
|
| 220 | - } |
|
| 221 | - default: |
|
| 222 | - error_redirect('unsupported_response_type', 'Specified response_type is not supported, only "token" or "code" types available'); |
|
| 200 | + case 'token': |
|
| 201 | + $token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], $redirect_uri); |
|
| 202 | + if ($token_data) { |
|
| 203 | + unset($token_data['refresh_token']); |
|
| 204 | + $url = http_build_url( |
|
| 205 | + $redirect_uri, |
|
| 206 | + array_merge( |
|
| 207 | + $token_data, |
|
| 208 | + [ |
|
| 209 | + 'state' => isset($_GET['state']) ? $_GET['state'] : false |
|
| 210 | + ] |
|
| 211 | + ) |
|
| 212 | + ); |
|
| 213 | + $url = implode('#', explode('?', $url, 2)); |
|
| 214 | + $Response->redirect($url, 302); |
|
| 215 | + $Page->Content = ''; |
|
| 216 | + return; |
|
| 217 | + } else { |
|
| 218 | + error_redirect('server_error', "Server can't get token data, try later"); |
|
| 219 | + return; |
|
| 220 | + } |
|
| 221 | + default: |
|
| 222 | + error_redirect('unsupported_response_type', 'Specified response_type is not supported, only "token" or "code" types available'); |
|
| 223 | 223 | } |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | 0, |
| 93 | 93 | strpos($table_name, '"') |
| 94 | 94 | ); |
| 95 | - $update = preg_replace_callback( |
|
| 95 | + $update = preg_replace_callback( |
|
| 96 | 96 | '/"([^"]+)"/', |
| 97 | 97 | function ($matches) { |
| 98 | 98 | return "\"$matches[1]\" = EXCLUDED.\"$matches[1]\""; |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | /** |
| 408 | 408 | * Narrow the dependencies to current module only |
| 409 | 409 | */ |
| 410 | - $dependencies = array_unique( |
|
| 410 | + $dependencies = array_unique( |
|
| 411 | 411 | array_merge( |
| 412 | 412 | ['System'], |
| 413 | 413 | $dependencies['System'], |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | * @return string[][] |
| 482 | 482 | */ |
| 483 | 483 | protected function add_versions_hash ($includes) { |
| 484 | - $content = array_reduce( |
|
| 484 | + $content = array_reduce( |
|
| 485 | 485 | get_files_list(DIR.'/components', '/^meta\.json$/', 'f', true, true), |
| 486 | 486 | function ($content, $file) { |
| 487 | 487 | return $content.file_get_contents($file); |
@@ -327,7 +327,7 @@ |
||
| 327 | 327 | /** |
| 328 | 328 | * If content is link to CSS file |
| 329 | 329 | */ |
| 330 | - $css = static::css( |
|
| 330 | + $css = static::css( |
|
| 331 | 331 | file_get_contents("$dir/$url"), |
| 332 | 332 | "$dir/$url", |
| 333 | 333 | $not_embedded_resources |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | <FilesMatch "\.css$"> |
| 89 | 89 | Header set Content-Type text/css |
| 90 | 90 | </FilesMatch> |
| 91 | -HTACCESS |
|
| 91 | +htaccess |
|
| 92 | 92 | ); |
| 93 | 93 | } |
| 94 | 94 | foreach ($files as $file) { |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | Header set Content-Type application/octet-stream |
| 147 | 147 | </ifModule> |
| 148 | 148 | |
| 149 | -HTACCESS; |
|
| 149 | +htaccess; |
|
| 150 | 150 | if (is_dir(STORAGE.'/Composer/vendor/bower-asset')) { |
| 151 | 151 | file_put_contents(STORAGE.'/Composer/vendor/bower-asset/.htaccess', $htaccess_contents); |
| 152 | 152 | } |
@@ -55,11 +55,11 @@ |
||
| 55 | 55 | * Try to load classes from different places. If not found in one place - try in another. |
| 56 | 56 | */ |
| 57 | 57 | if ( |
| 58 | - file_exists($file = __DIR__."/classes/$namespace/$class_name.php") || //Core classes |
|
| 58 | + file_exists($file = __DIR__."/classes/$namespace/$class_name.php") || //Core classes |
|
| 59 | 59 | file_exists($file = __DIR__."/thirdparty/$namespace/$class_name.php") || //Third party classes |
| 60 | - file_exists($file = __DIR__."/traits/$namespace/$class_name.php") || //Core traits |
|
| 61 | - file_exists($file = __DIR__."/engines/$namespace/$class_name.php") || //Core engines |
|
| 62 | - file_exists($file = MODULES."/../$namespace/$class_name.php") || //Classes in modules |
|
| 60 | + file_exists($file = __DIR__."/traits/$namespace/$class_name.php") || //Core traits |
|
| 61 | + file_exists($file = __DIR__."/engines/$namespace/$class_name.php") || //Core engines |
|
| 62 | + file_exists($file = MODULES."/../$namespace/$class_name.php") || //Classes in modules |
|
| 63 | 63 | file_exists($file = PLUGINS."/../$namespace/$class_name.php") //Classes in plugins |
| 64 | 64 | ) { |
| 65 | 65 | $cache[$class] = realpath($file); |