Commit Graph

370 Commits

Author SHA1 Message Date
Kamil Tekiela
d425a16078 Use early exit
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2025-12-22 22:16:57 +00:00
Kamil Tekiela
c3645d9076 Fix bug in userDir
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2025-12-22 20:57:26 +00:00
Maurício Meneghini Fauth
5ec6b2f405
Fix some PHP 8.5 deprecations
Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
2025-11-10 23:01:10 -03:00
Ayesh Karunaratne
8c54f472e6
[PHP 8.4] str_getcsv: Fix $escape parameter deprecation
In PHP 8.4, not passing the `$escape` parameter to the `str_getcsv`
function emits a deprecation error. This fixes the notice by passing
the identical default value for the `$escape` parameter.

 - [Initiating RFC](https://wiki.php.net/rfc/kill-csv-escaping)
 - [Deprecation RFC](https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_proprietary_csv_escaping_mechanism)
 - [PHP 8.4: CSV: The `$escape` parameter must be provided](https://php.watch/versions/8.4/csv-functions-escape-parameter)

Signed-off-by: Ayesh Karunaratne <ayesh@aye.sh>
2024-11-17 13:55:28 +07:00
Liviu-Mihail Concioiu
02b508276e
Add fractional seconds to current_timestamp()
Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
2024-07-13 12:45:34 -03:00
Maximilian Krög
626aa23841
Remove duplicate server and lang param from links
Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2024-05-03 02:54:06 +02:00
Luca Camillo
78335aac87
Add role based auth for MySQL 8.x and compatibles (#18814)
* add role based auth for mysql 8.x or compatible like mariadb/aws rds aurora mysql

Signed-off-by: Luca Camillo <luca.camillo@gmail.com>

* Using cache and check server version

Signed-off-by: Luca Camillo <luca.camillo@gmail.com>

* implement tests for getCurrentRolesAndHost / getCurrentRoles functions

Signed-off-by: Luca Camillo <luca.camillo@gmail.com>

* fix role checks on mariadb

Signed-off-by: Luca Camillo <luca.camillo@gmail.com>

* Simplify code + ignore NONE as result of CURRENT_ROLE()

Signed-off-by: Luca Camillo <luca.camillo@gmail.com>

* Fix tests

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>

Fixes #18782

---------

Signed-off-by: Luca Camillo <luca.camillo@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-03-02 19:31:03 -03:00
Kamil Tekiela
d7a64dc0a8 Fix ENUM value parsing
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-11-29 15:22:22 +01:00
Kamil Tekiela
09fe98bbfe Add simpler implementation of parseEnumSetValues
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2023-09-05 21:57:50 +01:00
Nicolas Hervouet
e4d9a1a66a
Fix for handle large number of tables in a single database (more than 10k)
getTablesFull was taking too much time, because MySQL do not have a real table where it stores all tables information.
So when it runs a query like select * from information_schema.TABLES ORDER BY Name limit 250 offset 0, MySQL has to read information about all tables to build his in memory table, then sort it by name, and then return 250 first tables.
But reading information about one table takes time, and that's why the query is very slow when you have a lot of tables.
Note that the problem is the same with 'SHOW TABLE STATUS'.

So, in order to speed up this query, we have to limit it to a small list of tables, as it, MySQL has to read table information only for few tables.
Note that SHOW TABLES is not that long, even with a large amount of tables.

The idea here is to use the result of SHOW TABLES query, to apply paging on this table list, and then to run the query on information_schema.TABLES only on tables we want.

Signed-off-by: Nicolas Hervouet <github@pico12.fr>
2023-03-24 11:55:30 -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
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
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
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
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
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
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
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
Kamil Tekiela
7bc897b56e Use escapeMysqlLikeString instead of escapeMysqlWildcards
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2022-02-13 18:03:34 +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
Maurício Meneghini Fauth
0b575ff2e9
Fix URL encryption for Util::linkOrButton method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2022-01-10 12:19:44 -03: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
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
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
Kamil Tekiela
253b08330d Make $subPart non-nullable and remove redundant ?? when it's not null
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
2021-12-03 19:36:06 +00:00
Kamil Tekiela
1270efc2a9
Refactor util.php (#17212)
* Remove extra space

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

* Remove null checks on properties that cannot be null

The value could be null only if the property exists in stdClass
returned by mysqli but is null. Mysqli doesn't do that. Unless the value
can be null in some other way, this check is redundant.

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

* Add psalm-return

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

* Remove $handle parameter of getUniqueCondition()

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

* Type hint the $row parameter

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

Co-authored-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-12-02 17:37:09 -03:00
Maurício Meneghini Fauth
a835d7cfcc
Remove array support from Util::backquote
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-11-10 19:33:09 -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
7955f7d96d
Replace pow function with the ** operator
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-27 19:12:11 -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
3f87370978
Suppress strftime deprecation messages for PHP 8.1
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-12 12:25:06 -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
30fac275c5
Suppress some PHP 8.1 deprecations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-21 17:44:21 -03:00
William Desportes
87c6181568
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-08-08 02:49:47 +02:00
Lukas Bixen
c0fe75bc67 Fix DEL character in generated random strings
Apply suggestions from code review:
Use identical operator and improve comment

Signed-off-by: Lukas Bixen <lrb2_@outlook.com>
2021-08-07 12:07:30 -05:00
Maurício Meneghini Fauth
04d3c83559
Fix some errors found by PHPStan/Psalm
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-08-05 16:09:08 -03:00
William Desportes
9373c8ec70
Merge branch 'QA_5_1'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-22 14:51:35 +02:00
William Desportes
d281dcc0bd
Fix #17026 - Handle possible invalid boolean values injected in SaveDir or UploadDir
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-22 12:59:54 +02:00
Maximilian Krög
c1c6b01195
Use correct min MySQL version for axis-order (8.0.1)
There was no version 8.0.10
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html

Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
2021-07-20 01:28:29 +02:00
William Desportes
b4652b108e
Remove non used Util::getFirstOccurringRegularExpression
Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-16 03:17:29 +02:00
William Desportes
34acbcdc38
Fix calls to fetchRow using two parameters but function has only one parameter
None of our fetchRow methods have more than one parameter

Thank you Psalm for catching this !

Signed-off-by: William Desportes <williamdes@wdes.fr>
2021-07-16 02:28:03 +02:00