Commit Graph

72 Commits

Author SHA1 Message Date
Maurício Meneghini Fauth
6122dfd0be
Replace exit with exception in Session class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-17 22:06:51 -03:00
Maurício Meneghini Fauth
a2a3f6d26d
Create a factory for auth plugin creation
Extracts the factory method from the Plugins class into a new class.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-16 19:32:10 -03:00
Maurício Meneghini Fauth
0379fcc385
Remove the auth_plugin global variable
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-16 16:51:22 -03:00
Maurício Meneghini Fauth
a6b7e5ef28
Remove exit construct from Plugins::getAuthPlugin()
Throws exception for invalid auth plugin instead of exiting.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-16 16:25:51 -03:00
Maurício Meneghini Fauth
561d9ca705
Remove containerBuilder global variable from Common class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-16 11:41:08 -03:00
Maurício Meneghini Fauth
b783681a8b Remove Config::fatalErrorHandler() method
Since there is an error handler register already, error_get_last is
always empty.

Also adds a try-catch to catch exceptions from the config file.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-16 10:27:18 -03:00
Maurício Meneghini Fauth
ad5e2abdab
Throw ConfigException for some Config errors
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-15 19:03:01 -03:00
Maurício Meneghini Fauth
b2eb6bf4c9
Extract config load and check from Config's constructor
This allows better handling of the user's config loading and validation.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-15 13:20:13 -03:00
Maurício Meneghini Fauth
c88152cf59
Use more specific exceptions for some errors
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-31 22:32:12 -03:00
Maurício Meneghini Fauth
103968f352
Replace fatalError() with exception in Core::warnMissingExtension()
Also moves some other calls to Core::warnMissingExtension() to the
Common::checkRequiredPhpExtensions() method.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-31 20:25:55 -03:00
Maurício Meneghini Fauth
3121dae621
Replace Core::fatalError() calls from the Common class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-31 20:25:54 -03:00
Maurício Meneghini Fauth
a7cb439d2a
Extract method that sets the server global variable
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-23 02:38:54 -03:00
Maurício Meneghini Fauth
22f1038ebb
Extract method that sets the sql_query global variable
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-23 02:16:17 -03:00
Maurício Meneghini Fauth
9706987031
Move /messages HTTP headers to the JavaScriptMessagesController
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-22 22:42:43 -03:00
Maurício Meneghini Fauth
334bd84002
Move Routing::callControllerForRoute call to Common class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-22 09:56:22 -03:00
Maurício Meneghini Fauth
49e7d82c0f
Extract setup routing logic to the Routing class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-22 09:56:21 -03:00
Maurício Meneghini Fauth
dbb9d68236
Extract setup page bootstrap to the Common class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-22 09:56:21 -03:00
Maurício Meneghini Fauth
2c3ce59718
Remove isMinimumCommon variable from global space
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-21 13:51:58 -03:00
Luca Perna
d1b5cb6987
16276 - Reduce the usage of SuperGlobals (#17795)
Signed-off-by: Luca Perna <luca@perna.rocks>
2022-10-20 01:52:38 -03:00
Maurício Meneghini Fauth
bb97ed988f
Reduce usage of the containerBuilder global variable
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-29 22:36:46 -03:00
Maurício Meneghini Fauth
6792b17e72
Add tryFromValue method to DatabaseName and TableName classes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-09-18 16:32:42 -03:00
Maurício Meneghini Fauth
5acfb45262
Fix some errors in Common class found by Psalm
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-08-23 17:00:09 -03:00
Maurício Meneghini Fauth
87d695f2c8
Extract js/messages.php entry point into a route
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-08-06 22:25:32 -03:00
Maurício Meneghini Fauth
75cf045fa3
Extract url.php entry point into a route
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-08-06 15:02:49 -03:00
Maurício Meneghini Fauth
eb3703882b
Move Routing::getCurrentRoute to ServerRequest
The route is retrieved from the request, so it makes sense to move the
method to the Http\ServerRequest class.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-06-06 23:36:57 -03:00
Maurício Meneghini Fauth
3d3010916e
Fix an issue reported by Psalm
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-05-21 17:31:03 -03:00
Maurício Meneghini Fauth
2c5143feda Remove ResponseRenderer::getFooter method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-09 12:32:14 -03:00
Maurício Meneghini Fauth
0d4d2a4935
Add exceptions for invalid identifier names
- Adds the PhpMyAdmin\Dbal\InvalidIdentifierName exception
- Adds the PhpMyAdmin\Dbal\InvalidDatabaseName exception
- Adds the PhpMyAdmin\Dbal\InvalidTableName exception

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-19 17:35:35 -03:00
Maurício Meneghini Fauth
5950693fb3
Fix possible undefined globals
Related to https://github.com/phpmyadmin/phpmyadmin/pull/17427.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-10 18:05:21 -03:00
Maurício Meneghini Fauth
1438cb211e
Replace global keyword with $GLOBALS
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-07 17:31:11 -03:00
Maurício Meneghini Fauth
7aec65222a
Fix an issue reported by PHPStan
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-02-28 12:21:11 -03:00
Maurício Meneghini Fauth
5a34a3bb04
Remove db and table properties from controllers
Replaces them with their respective globals.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-02-02 14:48:43 -03:00
Kamil Tekiela
47e81a5161 Remove $route global
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-01-27 11:47:40 +00:00
Kamil Tekiela
ef6dbe05ec Implement Common::getRequest() to remove global
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-01-27 11:42:39 +00:00
Maurício Meneghini Fauth
0bee94b27e
Merge branch 'QA_5_1-security' into master-security
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-01-11 14:31:56 -03:00
Maurício Meneghini Fauth
ca91eaeb38
Accept mixed for DatabaseName and TableName constructors
This avoids redundant type assertions.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-23 16:25:05 -03:00
Maurício Meneghini Fauth
995ec44d13
Move DatabaseInterface::initRelationParamsCache method to Relation class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-17 12:09:13 -03:00
Maurício Meneghini Fauth
9e2bb1e996
Replace Assert exceptions with a more specific one
Catches only \Webmozart\Assert\InvalidArgumentException instead of all
\InvalidArgumentException.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-09 14:50:25 -03:00
Maurício Meneghini Fauth
0c781c9335
Rename TableName|DatabaseName create method to fromString
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-30 22:14:51 -03:00
Maurício Meneghini Fauth
88b48c810d
Use ServerRequest for Table\Partition controllers
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-30 16:56:34 -03:00
Maurício Meneghini Fauth
3e0856c77b
Remove useless string concatenations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-27 21:40:22 -03:00
Maurício Meneghini Fauth
a1113b282f
Use DatabaseName and TableName to validate db and table values
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-23 21:51:07 -03:00
Maurício Meneghini Fauth
f61d3183fb
Inline some phpcs ignores and remove deprecated annotations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-12 11:59:39 -03:00
Maurício Meneghini Fauth
8f2f3eff40
Remove the Core::isValid method
This improves the type checking and simplifies the code.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-02 13:20:50 -03:00
William Desportes
b72f941167
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-08-23 20:35:42 +02:00
Maurício Meneghini Fauth
355f6d9d20
Remove PhpMyAdmin\Config::enableBc method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-09 13:59:04 -03:00
Maurício Meneghini Fauth
519533a202
Merge branch 'QA_5_1'
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-07 14:19:49 -03:00
Maurício Meneghini Fauth
262cbe45b9
Move some Core methods to Common class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-06 16:52:54 -03:00
Maurício Meneghini Fauth
a0d91ec153
Move common.inc.php to classes/Common.php
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-06 14:00:44 -03:00
Maurício Meneghini Fauth
c11e8d5f64 Remove Common::database method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-11-02 18:56:58 -03:00