Maurício Meneghini Fauth
342ab3f67a
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-27 14:36:32 -03:00
Kamil Tekiela
0bdcaba2d2
Add native property types ( #18143 )
...
* Add native property types
Includes TypeHints.UnionTypeHintFormat
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Set some default values for properties
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Format and promote properties
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove redundant asserts
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant cast
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $tmanager->theme is never null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant variable
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix empty on $statementInfo bool
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant casts
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant issets
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getPacked() returns nullable string
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Redundant if
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $this->content can be null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Simplify ThemeManager::getInstance()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Use isset for checking if property is initialized
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Use nullable instead of uninitialized property
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* password is no longer nullable
I can't verify that none of the globals ever tried to set it to null, but the variable should never be nullable.
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update baselines
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* $same_wide_width param can be float or int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update Message.php
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast Sub_part to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix one line doc comments
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-26 23:30:41 -03:00
Maurício Meneghini Fauth
77957a69a5
Add trailing comma for multi-line functions
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-24 20:48:46 -03:00
Kamil Tekiela
e8c5eef6f8
Remove annoying empty statements ( #18114 )
...
* Remove annoying empty statements
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Make $extra strict and stop passing false to it
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Make $page strict and stop passing null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-24 20:11:37 -03:00
Kamil Tekiela
902d1a1e77
Add native return type hints ( #18126 )
...
* Add remaining native return type hints to flush out bugs
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast the mixed value to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Fix tests
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getAutoIncrement() is supposed to return string
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast values to string in DummyResult
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Make getCollation() return non-nullable string
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast seqInIndex to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Cast $cardinality to int
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* createFile may return false
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Remove redundant cast
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Update baselines
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-23 15:43:36 -03:00
Kamil Tekiela
aa63c6821a
Fix bug related to tables with numerical names
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-22 13:18:06 +00:00
Maurício Meneghini Fauth
47846068fa
Remove some useless comments
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 23:45:06 -03:00
Maurício Meneghini Fauth
4ff3724c3f
Use union with null instead of short nullable type
...
Since union type are now possible, using union with null makes more
clear that it is a union type.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-20 21:48:19 -03:00
Kamil Tekiela
80c4db7253
Use strict check when type is known
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-19 23:19:54 +00:00
Kamil Tekiela
cb2e1932f8
Better array types part 1 ( #18096 )
...
* Plugins getScripts() return array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* These methods always return an array
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* extractPrivInfo returns an array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getInfoPages returns an array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* returnClassNamesFromMenuButtons returns a string map
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Use array shape for getDatabasesForSelectOptions
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Some methods in Table return array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* getLines returns an array if ints
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* Array shapes in TwoFactor
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
* parseEnumSetValues always returns an array of strings
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 16:52:00 -03:00
Kamil Tekiela
cfe54a501b
Add union types
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 15:23:28 +00:00
Kamil Tekiela
2b35303aae
Remove redundant code ( #18063 )
...
PHPStorm has been a little annoying with showing all these code issues. I took some time to analyse most of them and fix whichever were easy to fix. This kind of change should improve future maintenance as developers do not need to wonder what a line of code does. Code that has no impact on functionality should be removed.
* Remove redundant variables
* Invert condition for better clarity
* Remove some of the redundant casts
* Replace switch with an if
* Fix foreach variable
* Remove redundant variable concat
* Remove redundant concats
* Replace for loop with str_repeat
* Remove always true param
* Turn property $position into local var
* Turn Pdf properties into local vars
* Remove unused properties in Pdf
* Change ternary into condition
* Remove redundant assignments
They are immediately overwritten with a different value.
* Redundant array append
* Collapse if statements into assignments
* Use boolean constants instead of variables
* Remove unneeded parameter
* Remove null-coalesce
* Unnecessary assignment
* Remove redundant isset
* Remove readOnly flag for InsertEdit fields
* Remove function_exists and $mode var
* Remove duplicate condition
* Remove redundant elseif
* Remove redundant isset
* Use hasBodyParam()
* Simplify isRoutesCacheFileValid()
Psalm complains but is wrong.
https://github.com/phpmyadmin/phpmyadmin/pull/18063
---------
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-15 09:11:05 -03:00
Kamil Tekiela
87e42d591c
Use short closures where possible
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-02-14 13:44:42 +00:00
Maurício Meneghini Fauth
040b4c582d
Bump minimum PHP version to 8.1.0
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-02-10 19:20:51 -03:00
Kamil Tekiela
7a22334167
Designer controller globals ( #17985 )
...
* Remove globals from DesignerController
* Remove $GLOBALS['params'] in ManageController
* Remove $GLOBALS['params']
* Remove $GLOBALS['total_num_tables']
* Remove $GLOBALS['tooltip_truename']
* Remove $GLOBALS['tooltip_aliasname']
* Remove $GLOBALS['pos']
* Remove $GLOBALS['tables'] (partially)
* Remove $GLOBALS['num_tables'] (partially)
* Remove redundant calls to Util::getDbInfo()
* Move unrelated functionality out of getDbInfo()
* Extract new method getTableListPosition()
* Code style changes
* Update phpstan-baseline.neon
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-01-26 22:58:24 -03:00
Kamil Tekiela
e37c240c9c
Remove old !== null check
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-01-26 20:20:00 +00:00
Kamil Tekiela
6264f6f1ea
Various refactorings 2 ( #17965 )
...
* Remove extra blank lines
* Remove useless param annotations
* Refactor Index::singleton
* Refactor Config.php
* Refactor Header::addRecentTable()
* Collapse return statement into a single line
* Refactor Message.php
* Convert $getUniqueCondition into a scalar
* Code style
* Fix invalid return phpdoc
* Remove unused variable
* Remove redundant empty array checks
* Refactor Export::closeFile()
* Simplify else statement
* Remove redundant else
* Refactor TablePartitionDefinition::getDetails
* Simpler returns
* Add types for getCellContent()
* Remove useless method mngInsideStructComm
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-12-24 12:54:23 -03:00
Kamil Tekiela
dd699f348d
Clean up LIKE escaping
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-11-25 00:06:52 +00:00
Maurício Meneghini Fauth
ca489f3b41
Improve type of DatabaseInterface::getLowerCaseNames()
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-19 15:50:14 -03:00
William Desportes
c08b4a78f3
Merge branch 'QA_5_2'
...
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-11-14 14:26:16 +01:00
William Desportes
f89cb7050a
Add sodium to the extension list on the main page
...
It has a polyfill and would be nice to know that it is installed
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-11-14 14:24:44 +01:00
Maurício Meneghini Fauth
f103bdc1e2
Replace $_REQUEST with ServerRequest in Util::getDbInfo()
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-08 00:06:25 -03:00
Maurício Meneghini Fauth
97aac39a40
Remove the sub_part global variable
...
It's only used inside Util::getDbInfo() for pagination when not
exporting.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-11-07 22:06:59 -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
William Desportes
25c13d667b
Merge branch 'QA_5_2'
...
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-10-26 12:22:38 +02:00
Mo Sureerat
aeab8a1c41
Fix #17793 - insert UUID ( #17797 )
...
* Add/Change table schema - Add UUID in default options
* Insert/Update - Generate uuid only not defined and not check null option
* Add/Change table schema - Hide UUID from default options if database not support & add unit test
Fix #17793
Signed-off-by: Mo Sureerat <sureemo@gmail.com>
2022-10-20 15:57:53 -03:00
Maurício Meneghini Fauth
3890d11dd8
Fix some coding style issues
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-16 17:18:54 -03:00
Maurício Meneghini Fauth
ba02d77c53
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-09 15:18:27 -03:00
Mo Sureerat
f0a938f783
Fix issue - Edit/Copy/Delete row doesn't work when using GROUP BY ( #17758 )
...
* Fix issue - Edit/Copy/Delete row doesn't work when using GROUP BY
Root cause: GROUP_FLAG and NUM_FLAG have the same flags value 32768
Reference to https://www.php.net/manual/en/mysqli-result.fetch-fields.php
Fixes #17756
Signed-off-by: Mo Sureerat <sureemo@gmail.com>
2022-10-09 14:33:21 -03:00
Maurício Meneghini Fauth
9cdf0b1cd9
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-10-03 21:00:20 -03:00
William Desportes
49b4951cbb
Document why zlib is the only value for a compressed column
...
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-09-30 23:39:50 +02:00
Fawzi E. Abdulfattah
1be3cad6e3
Supporting the compressed option for MariaDB
...
Ref: #14956
Signed-off-by: Fawzi E. Abdulfattah <iifawzie@gmail.com>
2022-09-30 23:11:22 +02:00
Maurício Meneghini Fauth
4ad66f464f
Fix some errors reported by PHPStan
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-28 22:53:38 -03:00
Rodrigo Pokemaobr
be976e4b57
Adjusting parameters in ExportPlugin class
...
Signed-off-by: Rodrigo Pokemaobr <contato@pokemaobr.dev>
2022-04-28 16:32:06 -03:00
Maurício Meneghini Fauth
4891f2dc74
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-21 14:45:17 -03:00
Maurício Meneghini Fauth
4c1668d663
Merge branch 'QA_5_1' into QA_5_2
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-21 14:29:25 -03:00
Maurício Meneghini Fauth
533766b3d7
Merge pull request #17437 from erolatreston/switch-user-QA_5_1
...
Allow authentication plugin to switch database users
2022-04-21 13:55:47 -03:00
Maurício Meneghini Fauth
ce14c14544
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-05 20:26:56 -03:00
Maurício Meneghini Fauth
cd1bef6c70
Merge branch 'QA_5_1' into QA_5_2
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-04-05 19:50:06 -03:00
Rodrigo Pokemaobr
9e63cc27e0
Fixing geometry bug when clicking in edit or copy in browse link
...
Signed-off-by: Rodrigo Pokemaobr <contato@pokemaobr.dev>
2022-04-05 14:24:27 -03:00
Maurício Meneghini Fauth
c0941401c1
Merge branch 'QA_5_2'
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-11 14:26:19 -03:00
Maurício Meneghini Fauth
2653b2942b
Merge branch 'QA_5_1' into QA_5_2
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-11 13:02:15 -03:00
Erol Guven
8920eae5db
Allow authentication plugin to switch database users
...
Signed-off-by: Erol Guven <erol.guven@appian.com>
2022-03-09 11:53:50 +00:00
Maurício Meneghini Fauth
f940693c75
Move Util::checkParameters method to the AbstractController
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-03-07 22:59:33 -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
Kamil Tekiela
7bc897b56e
Use escapeMysqlLikeString instead of escapeMysqlWildcards
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-02-13 18:03:34 +00:00
Kamil Tekiela
50303cd77e
Fix numerical keys
...
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-02-12 20:11:04 +00:00
Maurício Meneghini Fauth
7aaab24463
Remove the phpseclib dependency
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-01-13 17:43:50 -03: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
02e8588404
Merge branch 'QA_4_9-security' into QA_5_1-security
...
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-01-10 18:39:23 -03:00