@@ -120,7 +120,7 @@ |
||
| 120 | 120 | if (isset($_POST['site_url'])) { |
| 121 | 121 | $url = $_POST['site_url']; |
| 122 | 122 | } else { |
| 123 | - $https = @$_SERVER['HTTPS'] ? $_SERVER['HTTPS'] !== 'off' : ( |
|
| 123 | + $https = @$_SERVER['HTTPS'] ? $_SERVER['HTTPS'] !== 'off' : ( |
|
| 124 | 124 | @$_SERVER['REQUEST_SCHEME'] === 'https' || |
| 125 | 125 | @$_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' |
| 126 | 126 | ); |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | <p style="color: red"><?=$warning?></p> |
| 169 | 169 | <button onclick="location.href = '/';">Go to website</button> |
| 170 | 170 | </table> |
| 171 | -HTML; |
|
| 171 | +html; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | if (count(explode('/', $_SERVER['REQUEST_URI'])) > 3) { |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | CRUD_helpers, |
| 24 | 24 | Singleton; |
| 25 | 25 | |
| 26 | - protected $data_model = [ |
|
| 26 | + protected $data_model = [ |
|
| 27 | 27 | 'id' => 'int:0', |
| 28 | 28 | 'parent' => 'int:0', |
| 29 | 29 | 'title' => 'ml:text', |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | LIMIT 1", |
| 196 | 196 | $section['parent'] |
| 197 | 197 | ) ?: $section['parent']; |
| 198 | - $update = $this->db_prime()->q( |
|
| 198 | + $update = $this->db_prime()->q( |
|
| 199 | 199 | [ |
| 200 | 200 | "UPDATE `[prefix]blogs_sections` |
| 201 | 201 | SET `parent` = '%2\$d' |
@@ -47,11 +47,11 @@ |
||
| 47 | 47 | * Try to load classes from different places. If not found in one place - try in another. |
| 48 | 48 | */ |
| 49 | 49 | if ( |
| 50 | - _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
| 50 | + _require_once($file = DIR."/core/classes/$namespace/$class_name.php", false) || //Core classes |
|
| 51 | 51 | _require_once($file = DIR."/core/thirdparty/$namespace/$class_name.php", false) || //Third party classes |
| 52 | - _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
| 53 | - _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
| 54 | - _require_once($file = MODULES."/../$namespace/$class_name.php", false) || //Classes in modules |
|
| 52 | + _require_once($file = DIR."/core/traits/$namespace/$class_name.php", false) || //Core traits |
|
| 53 | + _require_once($file = ENGINES."/$namespace/$class_name.php", false) || //Core engines |
|
| 54 | + _require_once($file = MODULES."/../$namespace/$class_name.php", false) || //Classes in modules |
|
| 55 | 55 | _require_once($file = PLUGINS."/../$namespace/$class_name.php", false) //Classes in plugins |
| 56 | 56 | ) { |
| 57 | 57 | $cache[$class] = realpath($file); |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | 'storage' => 'json', |
| 66 | 66 | 'components' => 'json' |
| 67 | 67 | ]; |
| 68 | - protected $table = '[prefix]config'; |
|
| 68 | + protected $table = '[prefix]config'; |
|
| 69 | 69 | protected function cdb () { |
| 70 | 70 | return 0; |
| 71 | 71 | } |
@@ -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]\""; |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | /** |
| 400 | 400 | * Narrow the dependencies to current module only |
| 401 | 401 | */ |
| 402 | - $dependencies = array_unique( |
|
| 402 | + $dependencies = array_unique( |
|
| 403 | 403 | array_merge( |
| 404 | 404 | ['System'], |
| 405 | 405 | $dependencies['System'], |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | * @return string[][] |
| 474 | 474 | */ |
| 475 | 475 | protected function add_versions_hash ($includes) { |
| 476 | - $content = array_reduce( |
|
| 476 | + $content = array_reduce( |
|
| 477 | 477 | get_files_list(DIR.'/components', '/^meta\.json$/', 'f', true, true), |
| 478 | 478 | function ($content, $file) { |
| 479 | 479 | return $content.file_get_contents($file); |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | protected function add_includes_on_page_manually_added ($Config) { |
| 495 | 495 | $configs = $this->core_config.$this->config; |
| 496 | 496 | /** @noinspection NestedTernaryOperatorInspection */ |
| 497 | - $styles = |
|
| 497 | + $styles = |
|
| 498 | 498 | array_reduce( |
| 499 | 499 | array_merge($this->core_css['path'], $this->css['path']), |
| 500 | 500 | function ($content, $href) { |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | } |
| 503 | 503 | ). |
| 504 | 504 | h::style($this->core_css['plain'].$this->css['plain'] ?: false); |
| 505 | - $scripts = |
|
| 505 | + $scripts = |
|
| 506 | 506 | array_reduce( |
| 507 | 507 | array_merge($this->core_js['path'], $this->js['path']), |
| 508 | 508 | function ($content, $src) { |