Commit Graph

283 Commits

Author SHA1 Message Date
Maurício Meneghini Fauth
04a5ad592c
Fix import shp failing test with dbase enabled
Ref ded87e3301

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2025-01-17 20:39:25 -03:00
William Desportes
ded87e3301
Fix #16936 - Do not specify the collation when creating tables for imported data
Backport of https://github.com/phpmyadmin/phpmyadmin/pull/19035

Signed-off-by: William Desportes <williamdes@wdes.fr>
2025-01-16 11:52:16 +01:00
Maurício Meneghini Fauth
598308d2aa
Add covers annotations to TransformationPluginsTest
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-10-15 02:57:54 -03:00
Maurício Meneghini Fauth
555ea56cbd
Make PHPUnit's assertions stricter
Backports #18993 to QA_5_2.

This makes merging QA_5_2 into master easier.

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-10-12 15:33:45 -03:00
Maurício Meneghini Fauth
7fc96d6621
Call PHPUnit static methods using static calls
Backports #18907 to QA_5_2.

This makes merging QA_5_2 into master easier.
Changes done using Rector.

- #18907

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-10-12 14:28:22 -03:00
Maurício Meneghini Fauth
46f2c8871c
Backport some fixes for PHPUnit 10 compatibility
- Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1070623

Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2024-08-13 20:13:18 -03:00
Maximilian Krög
582f2e6525
Export views after indexes
When a view uses USE INDEX syntax import failed because of
the missing index.

Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2024-04-28 02:11:43 +02:00
Maximilian Krög
cc2ab4bde6
Test for delimiter after exported trigger
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2024-04-01 03:11:38 +02:00
Maurício Meneghini Fauth
1d8367368e
Remove allowDeny_forbidden global
Fixes issue introduced by 2327dbf3c3.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-03-26 16:08:42 -03:00
Kamil Tekiela
85b1272a92 Fix import of empty tables from MediaWiki
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-01-25 17:44:47 +01:00
William Desportes
b2a98560f3
Fix #18495 - PHP 7.2 lint - doc format
Ref: fc98aff6d3

Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-11-16 17:13:23 +01:00
William Desportes
fc98aff6d3
Fix #18495 - Exporting procedures and triggers
Ref: 38a4328184
Reverts: 5a2baf607f

Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-11-16 17:03:39 +01:00
Maurício Meneghini Fauth
578dbb301c
Fix SQL statement not being displayed correctly on RTL languages
Fixes #18471

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-05-31 12:48:34 -03:00
Maurício Meneghini Fauth
5a2baf607f
Fix ExportSqlTest failing test
Related to https://github.com/phpmyadmin/sql-parser/pull/438

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-04-19 18:32:51 -03:00
Yuval Haor Noga
b305ec30fa
Ref #16451 - Increase max password length from 1000 to 2000
Signed-off-by: Yuval Haor Noga <yuvalhnoga@gmail.com>
2023-03-10 15:45:30 +01:00
Maurício Meneghini Fauth
f143d2a709
Add support for Web Authentication API
Adds a two factor authentication plugin that supports FIDO2/WebAuthn
security keys.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-01-16 18:20:05 -03:00
William Desportes
6d42cd8017
Add spellcheck="false" on some login text fields to avoid data leaks to spell checking services
Ref: https://www.otto-js.com/news/article/chrome-and-edge-enhanced-spellcheck-features-expose-pii-even-your-passwords

Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-01-16 12:43:54 +04:00
William Desportes
2f2f7d4c92
Add spellcheck="false" on password fields to avoid data leaks to spell checking services
Ref: https://www.otto-js.com/news/article/chrome-and-edge-enhanced-spellcheck-features-expose-pii-even-your-passwords

Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-01-16 12:39:10 +04:00
Maurício Meneghini Fauth
f6a03d405d
Improve type inference of TwoFactor::$config
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-12-28 15:50:43 -03:00
Maurício Meneghini Fauth
63102c1253
Add unit test for Plugins\TwoFactor\Key::getRegistrations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-12-15 22:54:33 -03:00
William Desportes
9c4a90137d
Fix #16988 - export as CSV/JSON/SQL/... no database selected
Fixes: #16988

Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-12-13 23:27:07 +01:00
Scott Mcgowan
6fc1401ee2
Fix column names option for CSV Export
Previously work was done to enable column names in CSV exports by
default. This change actually ended up overwriting the column name value
so that column names were included in all exports regardless of whether
or not the property was disabled. This commit changes the default for
column names to enabled as the original change intended, and removes
the property overwrite.

Signed-off-by: Scott McGowan mcgowanscott16@gmail.com
2022-11-25 21:15:49 +01:00
Kamil Tekiela
dcdbcc019b
Fix method casing
Ref: https://github.com/tecnickcom/TCPDF/pull/462

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-10-14 20:44:26 +02:00
Kamil Tekiela
c19f6ae9ce Fix isNumeric
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-10-10 15:02:15 +01:00
William Desportes
65c9f49c1e
Merge branch 'QA_5_1' into QA_5_2
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-02-06 15:45:57 +01:00
William Desportes
4e68f548f9
Ref #17298, #17344 - fix ODS import tests
Signed-off-by: William Desportes <williamdes@wdes.fr>
2022-02-06 14:20:59 +01:00
Maurício Meneghini Fauth
76bb42957e
Fix failing tests
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-01-26 15:02:39 -03:00
Maurício Meneghini Fauth
411bacf613
Use Sodium for auth cookies encryption
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-01-13 18:46:04 -03: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
Kamil Tekiela
f5bb90ebb9 Move queryAsControlUser - Dbal refactoring pt.3
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-01-06 19:31:27 +00:00
Kamil Tekiela
47a039d70c Implement ResultInterface & MysqliResult
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-31 23:59:24 +00:00
Maurício Meneghini Fauth
feca48cc76
Change return type of DatabaseInterface::getError method
Now, it returns last error message or an empty string instead of false
if no errors occurred.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-27 14:43:14 -03:00
Maurício Meneghini Fauth
d84af02945
Create VO classes for each RelationParameters features
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-26 19:17:58 -03:00
Maurício Meneghini Fauth
44fe103b9c
Remove @access annotations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-22 11:43:45 -03:00
Maurício Meneghini Fauth
bf49480160
Populate relation Session with RelationParameters class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-17 12:09:15 -03:00
Maurício Meneghini Fauth
c411121fd8
Move Relation classes into the ConfigStorage namespace
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-17 12:09:13 -03:00
Maurício Meneghini Fauth
c4575fd48b
Add methods to check for RelationParameters features
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-11 08:10:40 -03:00
William Desportes
7b469f57e1
Update testExportRoutines test after sql-parser 5.5.0
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-12-09 18:28:43 +01:00
Kamil Tekiela
a42803297c
Psalm fixes 3 (#17221)
* Update psalm-baseline.xml

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Small bug fixes

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* non-falsy-string is always true

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* currentSearch property is nullable

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove unusued parameter $columnIndex

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Use parameters instead of globals in sendEditor()

The two globals in this method are read-only. There is an unused
parameter in the signature. Let's add one more and use them instead of globals.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove unusued parameter $crlf

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-03 12:40:19 -03:00
Kamil Tekiela
56a832948c
Refactor DatabaseInterface.php (#17209)
* Use str_starts_with()

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant !empty()

!empty() on a declared variable is redundant.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Replace loop with array_column()

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Simpify assignment by removing temporary variable

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant if statements and array_merge

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove temporary variable

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Unindent code

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Add helper method fetchByMode()

This is done to avoid calling methods through variables. It is the same
in terms of performance.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Move if statements to where they are relevant

I had a choice to either move the while loop out of the if statements
or move the if statements inside. I decided it made more sense to move
them inside.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Add NULL to phpdoc for the two parameters that can be null

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Simplify return statement

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Improve performance and simplify code

Since we are always using STORE mode then we can use data_seek() method.
This will allow us to get rid of the loop and use fetchByMode() method.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Inline value defaulting

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant check

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* [bugfix] getColumnNames() should return an array of strings

There were multiple issues here. If we are selecting only a certain
column from the SQL then let's use the handy function instead of
array_keys. We will never get anything other than an array so checking
if it is not an array makes no sense. Returning null only to cast it to
an array is pointless. If really necessary, we could still check for an
empty array. The ColumnController returned the value without even
casting it to an array. I am not sure how jQuery/JavaScript dealt with it.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Refactor getColumnMapFromSql and add type hint

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Refactor getVirtualTables

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant loop

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Remove redundant usage of freeResult()

If there was no chance for the object to leak the scope and it is the
end of the scope then there's no reason to call this method.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Replace dynamic variable with declare one

It's always the same name. If we were creating more than one, we could
use associative array, but in this case there seems to be absolutely no
need for any of this. Dynamic variables make it harder to debug the code.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Update psalm-baseline.xml

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* Widen the condition per williamdes suggestion

This will allow value such as '' and '0' to pass through. Previously
`if(! empty($database))` and `if($database)` dissallowed them.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

* fetchResult() should return only arrays

Tests fixed to return arrays. Non-empty in case of true, empty in case
of false.
Fixed a lot of Psalm issues where the condition was always true.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-11-26 20:17:46 -03:00
Maurício Meneghini Fauth
b2a51c4d84
Create the RelationParameters value object
Replaces the $cfgRelation array with the RelationParameters value
object.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-11-14 18:22:36 -03:00
Maurício Meneghini Fauth
d49c243469
Use @requires annotation for required extensions
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-10-07 13:40:50 -03:00
Maurício Meneghini Fauth
67e96cf40c
Get default config values from Config\Settings classes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-30 12:04:47 -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
f00d70cccb
Remove useless whitespaces
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-15 17:05:40 -03:00
Maurício Meneghini Fauth
53dd6f11b0
Refactor setProperties method of Plugin classes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-28 16:50:08 -03:00
William Desportes
2c28a715b4
Add methods to DbiDummy and AbstractTestCase to control changing databases
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-08-24 02:01:00 +02:00
William Desportes
fa88ce2f00
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-08-10 15:39:23 +02:00
William Desportes
9249951f51
Fix test after #17014
Pull-request: #17064
Ref: #17014

This commit is the proof that the PR was right and that it works

Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-08-10 14:48:55 +02:00
William Desportes
0f05c686e4
Add tests for #17014
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-08-10 14:44:47 +02:00