Commit Graph

341 Commits

Author SHA1 Message Date
Maximilian Krög
215c37b548
Fix some type errors and update baselines
Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
2026-02-12 16:12:03 +01:00
Maximilian Krög
564678c686
Export triggers with DELIMITER $$
Signed-off-by: Maximilian Krög <maximilian.kroeg@geocept.com>
2026-02-12 15:46:59 +01:00
William Desportes
63ac9761fa
Merge #20020 - Fix #19987 - Reopening a function removes charset
Pull-request: #20020
Fixes: #19987
Signed-off-by: William Desportes <williamdes@wdes.fr>
2026-02-05 13:26:09 +01:00
Matin Noroozi
acafdb1591
Fix event creation when server drops past event
Signed-off-by: Matin Noroozi <100ztaa@gmail.com>
2026-02-01 17:40:44 +03:30
Declan Boylan
a5c12bb286 Fix: #19987: Reopening a function removes charset
- Psalm & PHPStan issues addressed
- Unused ignores from PHPStan baseline removed

Signed-off-by: Declan Boylan <declan.boylan@gmail.com>
2026-01-18 12:12:51 +00:00
Liviu-Mihail Concioiu
f3c7a5eb14
Remove whitespace to avoid double whitespace (#19336)
* Remove whitespace to avoid double whitespace

---------

Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
2024-10-26 12:07:03 -03:00
Kamil Tekiela
8a8eab813d Fix charset in procedure's parameter type
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-09-24 01:08:10 +01:00
Liviu-Mihail Concioiu
43f114a08d Fix Unknown storage engine InnoDB
Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
2024-09-04 04:50:17 +02:00
Kamil Tekiela
a6887f2630 Introduce type alias mapping
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2024-01-20 22:20:36 +01:00
William Desportes
a88c9a3dc0
Fix functions/routines modal contents truncated
Related to 5a2baf607f
Related to https://github.com/phpmyadmin/sql-parser/pull/438

Signed-off-by: William Desportes <williamdes@wdes.fr>
2023-04-22 14:52:14 +02:00
Kamil Tekiela
3ff0dd38d4
Remove invalid usages of htmlspecialchars()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
(cherry picked from commit 59ba203280)
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-12-15 14:00:41 -03:00
Maurício Meneghini Fauth
9f076774e5
Remove table-light CSS classes
These classes were added by 6408b7179a.
However they aren't exactly the same as thead-light classes that exists
in Bootstrap 4.

Related to https://github.com/phpmyadmin/phpmyadmin/issues/17455.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-05-14 17:31:31 -03:00
Kamil Tekiela
86031d2bf6 Deimplement fetchAssoc() helper
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-01-09 22:44:53 +00: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
83b4dda1a3 Change QUERY_STORE to QUERY_BUFFERED
Set the value to 0 instead of 1 and remove all unnecessary usages of this constant

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-01-01 01:46:01 +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
c4e2582e56
Use TableName for RelationParameters tables
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-26 19:17:57 -03:00
Maurício Meneghini Fauth
4e0141e19f
Merge pull request #17253 from kamil-tekiela/fetchValue
Remove $row_number from DatabaseInterface::fetchValue
2021-12-23 11:40:25 -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
Kamil Tekiela
70c86f5e21 Remove $row_number from DatabaseInterface::fetchValue
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-21 21:09:38 +00: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
4c3bf41d56
Use DatabaseName for RelationParameters::db instead of string
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-11 08:10:40 -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
Kamil Tekiela
945d887a10 Fix var annotation for Charset and Collation
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-09 22:25:58 +00: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
f446e6da88 Remove unused variables
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-03 15:12:56 +00:00
Kamil Tekiela
488e7cb5bf Use array_keys whenever only keys are needed in foreach
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-11-29 20:37:39 +00: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
Kamil Tekiela
58d9bb4a32 Refactor DatabaseInterface::getColumns()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-11-25 10:28:39 +00: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
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
4834c5fe7d
Remove bypass flag from Util::backquote method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-26 11:51:34 -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
9f3510d11a
Add bool return type where possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-14 20:11:51 -03:00
Maurício Meneghini Fauth
7f6472b2c2
Add void return type where possible
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-13 15:29:11 -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
Maurício Meneghini Fauth
5725516656
Inline Core::ifSetOr method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-01 13:29:05 -03:00
Maurício Meneghini Fauth
86798ec45e
Refactor PhpMyAdmin\Plugins::getChoice method
Extracts the getDefault method from the getChoice method and adds a
getName method to the Plugin interface.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-27 13:38:01 -03:00
Maurício Meneghini Fauth
84d175b282
Extract HTML from Plugins::getChoice method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-25 15:29:43 -03:00
Maurício Meneghini Fauth
7a4536d4d6
Remove PhpMyAdmin\Twig\PluginsExtension class
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-25 11:00:21 -03:00
Maurício Meneghini Fauth
2de0a7cbd7
Update Psalm baseline
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-28 12:11:52 -03:00
William Desportes
f77433b9b7
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-28 01:37:17 +02:00
William Desportes
42165e4953
Fix #15370 - Edit routine UI incorrectly removes too many escape slashes
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-27 23:12:04 +02:00
William Desportes
587536b766
Remove non used variables
Running: composer run psalm -- --alter --issues=UnusedVariable
And removing the false positives I reported upstream

Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-16 02:13:27 +02:00
S. B. Hunter
a0410aa77d
Replace REQUEST to POST in Routines.php (#16904)
Signed-off-by: Akihiro Asahara <akihiro.asahara@gmail.com>

Co-authored-by: Akihiro Asahara <akihiro.asahara@gmail.com>
2021-07-14 14:24:08 -03:00
Maurício Meneghini Fauth
1835ebb4fc
Replace mb_strpos !== false with str_contains
See: https://wiki.php.net/rfc/str_contains#case-insensitivity_and_multibyte_strings

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-10 13:43:40 -03:00
Maurício Meneghini Fauth
6ae07c96fb
Replace strpos !== false with str_contains
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-07-09 22:30:42 -03:00
Maurício Meneghini Fauth
9adaa912e1
Rename Response class to ResponseRenderer
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-06-30 12:35:22 -03:00