Merge branch 'QA_5_2' into STABLE

This commit is contained in:
Isaac Bennetch 2025-01-21 09:31:35 -05:00
commit 157ef631fb
677 changed files with 201047 additions and 129047 deletions

1
.gitattributes vendored
View File

@ -10,7 +10,6 @@
.eslintignore export-ignore
.weblate export-ignore
codecov.yml export-ignore
build.xml export-ignore
infection.json.dist export-ignore
phpcs.xml.dist export-ignore
phpstan.neon.dist export-ignore

25
.github/.readthedocs.yaml vendored Normal file
View File

@ -0,0 +1,25 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
build:
os: ubuntu-24.04
tools:
python: "3.12"
jobs:
post_create_environment:
- python -m pip install sphinx-rtd-theme
# Build documentation in the "doc/" directory with Sphinx
sphinx:
configuration: doc/conf.py
# Fail on all warnings to avoid broken references
# fail_on_warning: true
# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
- epub
- htmlzip

23
.github/stale.yml vendored
View File

@ -1,23 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale Issue or Pull Request is closed
daysUntilClose: 7
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
# Label to use when marking as stale
staleLabel: wontfix
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label. Set to `false` to disable
unmarkComment: false
# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
closeComment: false
# Limit to only `issues` or `pulls`
only: pulls

View File

@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 12
@ -28,7 +28,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache Yarn dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
@ -51,7 +51,7 @@ jobs:
php-version: ["7.2"]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
@ -64,7 +64,7 @@ jobs:
- name: Install Composer dependencies
# Allow the previous check to fail but not abort
if: always()
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: highest
# Ignore zip for php-webdriver/webdriver
@ -73,7 +73,7 @@ jobs:
- name: Cache coding-standard
# Allow the previous check to fail but not abort
if: always()
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .phpcs-cache
key: phpcs-cache
@ -100,7 +100,7 @@ jobs:
php-version: ["7.2"]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
@ -109,7 +109,7 @@ jobs:
extensions: mbstring, iconv, mysqli, zip, gd, bz2
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: highest

View File

@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Lint phpdoc blocks
uses: sudo-bot/action-doctum@v5

View File

@ -13,8 +13,8 @@ jobs:
issues: write # for dessant/lock-threads to lock issues
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
process-only: 'issues'
issue-lock-inactive-days: 365
issue-inactive-days: 365

View File

@ -19,7 +19,7 @@ jobs:
operating-system: [ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Fetch github.base_ref (for diffing)
if: ${{ github.base_ref != '' }}
@ -42,7 +42,7 @@ jobs:
tools: composer:v2, infection
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: highest

View File

@ -16,15 +16,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
uses: actions/checkout@v4
- name: Install Sphinx for the documentation build
run: pip install 'Sphinx'
run: |
sudo apt-get update
sudo apt-get install -y sphinx-doc python3-sphinx
- name: Build the documentation
run: make -C doc html SPHINXOPTS='-n -W -a'
@ -36,7 +33,7 @@ jobs:
php-version: ["7.2"]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install gettext
run: sudo apt-get install -y gettext
@ -49,12 +46,12 @@ jobs:
tools: composer:v2
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: highest
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 12
@ -63,7 +60,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache Yarn dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
@ -71,9 +68,9 @@ jobs:
${{ runner.os }}-yarn-
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.11'
- name: Install Sphinx for the documentation build
run: pip install 'Sphinx'

View File

@ -59,13 +59,10 @@ jobs:
db-server: ["mysql:5.7"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Refresh apt cache
run: sudo apt-get update
uses: actions/checkout@v4
- name: Install gettext
run: sudo apt-get install -y gettext
run: sudo apt-get update && sudo apt-get install -y gettext
- name: Generate mo files
run: ./scripts/generate-mo --quiet
@ -77,26 +74,15 @@ jobs:
extensions: mbstring, iconv, mysqli, zip, gd, bz2
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: highest
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 12
- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache Yarn dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: 'yarn'
- name: Install modules
run: yarn install --non-interactive --production
@ -138,9 +124,9 @@ jobs:
./test/stop-local-server
- name: Upload screenshots
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: selenium-screenshots
path: ${{ github.workspace }}/build/selenium/**/*
retention-days: 1
retention-days: 3

View File

@ -29,7 +29,7 @@ jobs:
- { php-version: '8', experimental: false, arch: 's390x', exclude-phpunit-groups: 'extension-iconv,32bit-incompatible' }
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Write script
# tcpdf allowed memory exhausted needs the memory_limit workaround
@ -43,7 +43,7 @@ jobs:
apk add --update --no-cache \
php\$V-cli php\$V-mysqli php\$V-session php\$V-mbstring php\$V-ctype \
php\$V-iconv php\$V-xml php\$V-tokenizer php\$V-xmlwriter php\$V-simplexml \
php\$V-dom php\$V-json php\$V-bz2 php\$V-curl php\$V-gd php\$V-zip \
php\$V-dom php\$V-json php\$V-bz2 php\$V-curl php\$V-gd php\$V-zip php\$V-bcmath \
musl-locales musl-locales-lang \
gettext composer git && \
composer config version "$(php -r "define('VERSION_SUFFIX', ''); require_once('libraries/classes/Version.php'); echo \PhpMyAdmin\Version::VERSION;")" && \
@ -67,13 +67,13 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
php-version: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
experimental: [false]
os: [ubuntu-latest]
phpunit-options: ['--testsuite unit']
php-extensions: ['mbstring, iconv, mysqli, zip, gd, bz2']
include:
- php-version: 'nightly'
- php-version: '8.5'
experimental: true
os: ubuntu-latest
phpunit-options: '--configuration test/phpunit-php-nightly.xml'
@ -81,7 +81,7 @@ jobs:
php-extensions: 'mbstring, iconv, mysqli, zip, bz2'
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Fetch some commits for Scrutinizer coverage upload
fetch-depth: 15
@ -100,7 +100,7 @@ jobs:
coverage: xdebug
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: highest
composer-options: ${{ matrix.composer-options }}
@ -141,7 +141,7 @@ jobs:
extension: ["dbase", "recode"]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Fetch some commits for Scrutinizer coverage upload
fetch-depth: 15
@ -160,7 +160,7 @@ jobs:
coverage: xdebug
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: highest
@ -191,18 +191,20 @@ jobs:
coverage-reports: build/logs/clover.xml
test-php-psr7-implementations:
name: Test on PHP (+ psr7-${{ matrix.psr-7-library }}) ${{ matrix.php-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: Test on PHP ${{ matrix.php-version }} (+ psr7-${{ matrix.psr-7-library }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['7.3']
os: [ubuntu-latest]
php-version: ['7.2']
php-extensions: ['mbstring, iconv, mysqli, zip, bz2']
psr-7-library: ['guzzlehttp/psr7', 'nyholm/psr7', 'laminas/laminas-diactoros']
psr-7-library: ['guzzlehttp/psr7', 'slim/psr7', 'nyholm/psr7']
include:
# See: https://github.com/laminas/laminas-diactoros/releases/tag/2.18.0
- {psr-7-library: 'laminas/laminas-diactoros', php-version: '8.0'}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Fetch some commits for Scrutinizer coverage upload
fetch-depth: 15
@ -221,7 +223,7 @@ jobs:
coverage: pcov
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: highest
@ -262,10 +264,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 12
@ -274,7 +276,7 @@ jobs:
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache Yarn dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

View File

@ -21,7 +21,7 @@ jobs:
php-version: ["8.1"]
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Gettext
run: |
@ -34,7 +34,7 @@ jobs:
tools: composer:v2
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: highest

2
.gitignore vendored
View File

@ -66,3 +66,5 @@ infection.log
/js/vendor/openlayers/OpenLayers.js.LICENSE.txt
/setup/styles.rtl.css
/test/test_data/gis/
/public/
/app/

982
ChangeLog
View File

@ -1,6 +1,159 @@
phpMyAdmin - ChangeLog
======================
5.2.2 (2025-01-21)
- issue [security] Fix for a path disclosure leak in the Monitoring tab
- issue Prevent the user from deleting system databases
- issue [security] Fix an XSS vulnerability when checking tables (PMASA-2025-1)
- issue [security] Fix an XSS vulnerability on the Insert tab (PMASA-2025-2)
- issue [security] Fix a possible glibc/iconv vulnerability (CVE-2024-2961, assigned PMASA-2025-3 but please note that phpMyAdmin is not vulnerable by default)
- issue Fix for sql-parser relating to quadratic complexity in certain queries, which could have caused long execution times.
- issue #17851 Fix total count of rows in not accurate
- issue #17766 Allow to open in a new tab copy and edit row actions
- issue #17599 Fix error when handling an user that is not in privileges table
- issue #17364 Fix error when trying to import a status monitor chart arrangement
- issue #18106 Fix renaming database with a view
- issue #18120 Fix bug with numerical tables during renaming database
- issue #16851 Fix ($cfg['Order']) default column order doesn't have have any effect since phpMyAdmin 4.2.0
- issue #18138 Fix some issues with numerical table names
- issue #18112 Fix open base dir warning on git version class
- issue #18211 Fix the themes route missing the server ID
- issue Do not show "Original length undefined" on binary hex columns
- issue Fix wrong time zone when handling Git information
- issue #18195 Fix warning on non-existent table for XML export
- issue #18196 Fix errors of import notification
- issue #18093 Fix JS errors around "new user account" in some edge cases
- issue #16451 Increase password characters limit to 2000 during login
- issue #18177 Fix "IS NULL" is shown for non-nullable columns on search page
- issue #16199 Fix dragging of tables in designer
- issue #18268 Fix UI issue the theme manager is disabled
- issue #18258 Speed improvements when exporting a database
- issue #17702 Fix performance issue when handling large number of tables in a single database
- issue #18324 Fix UI defect on tracking versions table first column
- issue #18266 Fix disabling features (like `$cfg['Servers'][$i]['tracking'] = false;`) did not work
- issue #18296 Fixed query time measurement - measure time only for user queries
- issue #18235 Fix columns are misaligned for the "sys" database
- issue #18249 Speed improvements when browsing a database with multiple tables
- issue #18060 Fix Console height "Not a non-negative number" error
- issue #18188 Fix issue when editing GIS data
- issue Fix width/height of create routines modal and width of routines/triggers/events modals
- issue Stop pmadb database detection when all features are disabled
- issue Upgrade slim/psr7 to 1.4.1 for CVE-2023-30536 - GHSA-q2qj-628g-vhfw
- issue #17654 Fix unprivileged user cannot change password on MySQL >= 5.7.37
- issue #18385 Add CVE MITRE link to allowed domains and use cve.org
- issue #18330 Fix TypeError when no-datetime field is modified
- issue #18212 Fix Query Builder doesn't replace a table name with it's alias in the `WHERE` block
- issue #18221 Keep the criteria box collapsed by the user when un-checking the criteria checkbox
- issue #18363 Fix colspan for actions column on database table list
- issue Fix double encoding on User Groups pages
- issue Fix list of users of an user group not showing up
- issue Fix duplicate query params in the SQL message card
- issue #18314 Fix dragged row in index form
- issue #17392 Fix the actions not being hidden in the Triggers, Routines, Events pages
- issue #18441 Fix execute routine page not working when not in a modal
- issue #18471 Fix SQL statement not being displayed correctly on RTL languages
- issue Fix state times not getting summed in the profiling table
- issue Fix a case where a fatal error message was not displayed
- issue #17420 Fix profiling chart not loading when profiling is activated
- issue #18159 Fix error when changing the number of chart columns in the monitor page
- issue #18403 Fix Uncaught SyntaxError: JSON.parse on makegrid conditions
- issue #17528 Fix double escaping of database group names in the navigation tree
- issue #18473 Fix the NULL not applied after clearing nullable field
- issue #18454 Fix date field calendar display when changing NULL state
- issue #18481 Fix missing pagination when using SELECT DISTINCT
- issue #18325 Allow hex representations for integers in the search box validation
- issue #14411 Fixed double tap to edit on mobile devices
- issue Update documentation to reflect that Node >= 12 is required to compile the JS and CSS files
- issue #18578 Fixed PDF export NULL values gives a type error
- issue #18605 Fixed issue when executing a stored procedure
- issue #18650 Fixed double escaping on foreign key relation link title
- issue #18533 Fixed wrong count for simulated queries
- issue #18611 Fixed an error when searching a table without conditions
- issue #18663 Fixed case where triggers are dropped when moving a table
- issue #17404 Fixed an error message after dropping a database
- issue #18714 Fixed incorrect formatting of the amount of table rows
- issue #18717 Fixed issue when deleting bookmarks
- issue #18713 Fixed some issues with the GIS editor
- issue #18722 Fixed generic error message in the home page
- issue #18693 Fixed enum/set value escaping
- issue #18769 Improved collations support for MariaDB 10.10
- issue #17381 Fixed JS errors when editing indexes on create table
- issue #14402 Fix the PRIMARY label still shown when using two columns for a PK on create table
- issue #17347 Fixed JS errors when changing index settings on create table
- issue #18762 Fixed truncating tables when a VIEW is included
- issue Fix BETWEEN search does not validate input because of spaces
- issue Fix JS number validation does not validate when the input is empty or emptied
- issue #18561 Fix issue when adding System Monitor charts
- issue #17363 Fix duplicate route parameter after logging in
- issue #15670 Fix case where the data is truncated after changing a longtext column's collation
- issue #18797 Fixed support for ampersand as a arg separator
- issue #18834 Fixed case where column hash is empty in table relation page
- issue #17538 Fixed error when renaming an index
- issue #18865 Fix missing text-nowrap for timestamps columns
- issue #18613 Fixed routine editor showing wrong parameter type
- issue #18890 Fixed wrong row count when query has UNION
- issue #18949 Fixed natural sorting for items in the navigation section
- issue #18930 Fixed import of empty tables from MediaWiki
- issue #18940 Fixed issue when creating an unique key
- issue #19022 Fix case where tables from wrong database is loaded in navigation tree
- issue #18782 Fixed issue with role based auth for MySQL 8
- issue #18593 Fix drop db line included in server export if exporting only data
- issue #18049 Also check that curl_exec is enabled for the new version check
- issue #19023 Fixed table size for ROCKSDB engine showing as unknown
- issue #18451 Fix when editing inline central column, Null is always preselected
- issue #18495 Fixed database export missing routines
- issue #19117 Allow changing the virtuality of a column without any other changes
- issue #18566 Fixed error when importing exported view with USE INDEX hint
- issue #17920 Fixed moving column with empty default value will replace it with ''
- issue #18006 Fixed moving columns causes the default uuid() value to get quotes around it
- issue #18962 Fixed move columns with ENUM() & DEFAULT causes invalid SQL
- issue #18276 Fix on update CURRENT_TIMESTAMP doesn't show as default in attributes
- issue #18240 Fix inserting value with UNIX_TIMESTAMP() without a parameter
- issue #19125 Fixed CodeMirror tooltip is below modals
- issue #18674 Fix formatted sql in browse table result has a linebreak after each token
- issue #18210 Fixed add replica replication user on MariaDB doesn't work (SQL syntax)
- issue #19041 Fix footer.twig gets printed to Binary File Download
- issue #19091 Fix to stop processing queries on error
- issue #18241 Fix copy SQL query button on error messages
- issue #17190 Fix an error with SELECT ... FOR UPDATE queries
- issue #19145 Remove duplicate server and lang parameters from links
- issue #19158 Fix an issue with backticks on the query generator
- issue #19174 Fix an issue with column alias with asterisk on the query generator
- issue #19146 Fix column sorting with limit subquery
- issue #19152 Fix the number of lines being ignored in GIS visualization after a search
- issue #19189 Fix issue with column sorting when using 'group by'
- issue #19188 Fix issue with simulated queries reporting syntax errors
- issue #19141 Add cookie prefix '-__Secure-' to cookies to help prevent cookie smuggling
- issue #19218 Fix textarea horizontal resizing with Bootstap theme
- issue #19199 Add support for fractional seconds to current_timestamp()
- issue #19221 Fix query statistics for queries with count(*)
- issue #19203 Fix single quotes and backslashes for the query generator
- issue #19163 Fix queries with IS NULL or IS NOT NULL for the query generator
- issue #19181 Fix query generator support for IN() and NOT IN()
- issue #19167 Fix criteria on column '*' for the query generator
- issue #19213 Fix possible issue when exporting a large data set
- issue #19217 Fix issue when editing a cell of a JSON column
- issue #19244 Add yarn 1.22 to the package.json's packageManager field
- issue #19185 Fix visual issue when a row has only empty cells
- issue #19257 Fix issue when adding an index with an invalid name
- issue #19276 Fix compatibility with Twig 3.12
- issue #19283 Fix issue when the server starts with skip-innodb option
- issue #19299 Fix charset in procedure's parameter type
- issue #19316 Fix input size for hexadecimal values
- issue #19321 Suppress deprecation message of E_STRICT constant
- issue Fix PHP 8.4 `str_getcsv` `$escape` parameter deprecation
- issue #19426 Fix PHP warnings when the column is a `COMPRESSED BLOB`
- issue Allow opening server breadcrumb links in new tab with Ctrl/Meta key
- issue #19500 Use `KILL` instead of `CALL mysql.rds_kill` for non super users
- issue Fix "copy to clipboard" was adding a blank row for each repeating header row
- issue Fix TCPDF translations
- issue Remove underline for links on Bootstrap theme
- issue Fix sql editor height on multi-table query
- issue #18852 Fix notification color scheme on the Bootstrap dark theme
- issue #14542 Show the query even if no results are found in the Table search
- issue #16936 Fixed import (e.g. ods) doesn't respect database default collation
- issue #19000 Disable autocomplete for the create table/db name inputs
5.2.1 (2023-02-07)
- issue #17522 Fix case where the routes cache file is invalid
- issue #17506 Fix error when configuring 2FA without XMLWriter or Imagick
@ -115,835 +268,6 @@ phpMyAdmin - ChangeLog
- issue Add the Bootstrap theme
- issue #17499 Remove stickyfilljs JavaScript dependency
5.1.4 (not yet released)
- issue #17287 Fixed sorting the database list with "statistics" enabled on "Data" column creates a PHP type error
- issue #17368 Fix for invalid cache when losing access to config storage after it being cached
- issue #17387 Fix session cookie not respecting the CookieSameSite configuration directive in PHP 7.2
- issue #16769 Fix create index form accepting too many columns
- issue #16816 Disable editing to system schemas
- issue #16853 Add better error handling when IndexedDB is not working
- issue Fixed incorrect escaping of special MySQL characters on some pages
- issue #17188 Fix GIS visualization with an edited query
- issue #17418 Remove the use of the deprecated `strftime` function in OpenDocument exports
- issue #17111 Enable tabindex recompute on preview button while insert new rows
- issue #17474 Fix invalid SQL generated when PRIMARY/UNIQUE key contains a POINT column
- issue #17484 Fix setup's CSS not loading when the URL doesn't have a trailing slash
- issue #17494 Remove jQuery SVG JavaScript dependency
- issue #17335 Fix column visibility dropdown when the column name is too long
- issue #17445 Fix issue when exporting using Firefox or Safari on PHP 8.1.4
- issue Update JavaScript dependencies
- issue #17428 Fix case where errors were thrown when browsing a table
- issue #17508 Fix UI issue when user accounts page has the initials navigation bar
5.1.3 (2022-02-10)
- issue #17308 Fix broken pagination links in the navigation sidebar
- issue #17331 Fix MariaDB has no support for system variable "disabled_storage_engines"
- issue #17315 Fix unsupported operand types in Results.php when running "SHOW PROCESSLIST" SQL query
- issue #17288 Fixed importing browser settings question box after login when having no pmadb
- issue #17288 Fix "First day of calendar" user override has no effect
- issue #17239 Fixed repeating headers are not working
- issue #17298 Fixed import of email-adresses or links from ODS results in empty contents
- issue #17344 Fixed a type error on ODS import with non string values
- issue #17239 Fixed header row show/hide columns buttons on each line after hover are shown on each row
- issue [security] Fix for path disclosure under certain server configurations (if display_errors is on, for instance)
5.1.2 (2022-01-20)
- issue Replaced MySQL documentation redirected links
- issue #16960 Fix JS error on Designer visual builder on some modal buttons
- issue Re-build openlayers JS dependency from the source files and provide a smaller JS bundle
- issue Fixed imports and theme detection depending on the current working dir
- issue Update JavaScript dependencies
- issue #16935 Remove hardcoded row length for "$cfg['CharTextareaRows']" to allow back values < 7
- issue #16977 Fix encoding of enum and set values on edit value
- issue Fix set value as selected when it has special chars on edit value enum
- issue #16896 Fix distinct URLs broken on nullable text fields
- issue Fixed two possible PHP errors using INT data
- issue Fixed possible warning "Undefined index: output_format" on export
- issue Fixed warning "Undefined index: ods_recognize_percentages" on Import ODS
- issue Fixed warning "Undefined array key "ods_recognize_currency" on Import ODS
- issue #16982 Fixed "Notice: Undefined index: foreign_keys_data" on Designer remove relation
- issue Backquote phpMyAdmin table name on internal relation delete query for Designer
- issue #16982 Do not try to delete internal relations if they are not configured
- issue #16982 Show success messages on Designer for add and remove relation operations
- issue Fixed possible "Undefined index: clause_is_unique" on replace value in cell
- issue #16991 Fixed case where $_SERVER['REQUEST_METHOD'] is undefined
- issue Fixed configuration error handler registration
- issue #16997 Fixed server variables get/set value not working on multi server server > 1
- issue #16998 Fixed Multi table query submit on server > 1 logged out user
- issue #17000 Fixed Multi edit on central columns on server > 1 logged out user
- issue #17001 Fix PHP error on query submit without a table name on multi table query box
- issue #16999 Fixed multi table query results shows for 1 sec and then page refreshes
- issue Fixed a non translated button text on central columns add
- issue Fixed table width on Query by example page for large screens
- issue #16975 Fixed NULL default had a value on insert with datatime fields
- issue #16994 Fixed missing privilege escaping when assigning multiple databases with '_' to an user
- issue #16864 Fixed the margin on the last database of the tree on all themes when scrollbars are displayed
- issue #17011 Fixed the database tree line that was not continuous on database groups
- issue Build more syntax correct URLs on JS internal redirects
- issue #16976 Fix wrong link when a table is moved from a database to another
- issue #16985 Fix case-sensitive issue of innodb_file_format=barracuda vs innodb_file_format=Barracuda
- issue Fixed duplicate quote in navigation nodes
- issue #17006 Disable the URL limit for the MariaDB analyser feature
- issue Fix calls to fetchRow using two parameters but the function has only one parameter
- issue #17020 Fixed "Notice Undefined index: sql_query" on Insert page
- issue Fix reported "Undefined index: FirstDayOfCalendar"
- issue Fix reported "Undefined index: environment"
- issue Fix "TypeError: strlen() expects parameter 1 to be string, null given" on databases listing
- issue #16973 Fix "Undefined array key "n0_pos2_name"" on databases listing
- issue Use the correct min MySQL version for axis-order (8.0.1) instead of (8.0.11)
- issue Use the queries we asked the user confirmation for on DELETE and TRUNCATE table actions
- issue #16994 Fixed editing specific privileges for a database covered by a wildcard privilege
- issue #16994 Fixed escaping of the database name for databases containing '_' on users edit
- issue #16994 Only escape once on grant/revoke privileges for databases containing '_' or '%'
- issue #16994 Only show databases without a privilege on multi select for user grant databases
- issue Removed un-expected query success message from the Table export page
- issue #17026 Handle possible invalid boolean values injected in SaveDir or UploadDir causing "TypeError: mb_substr()"
- issue #16981 Enable cookie parameter "SameSite" on "phpMyAdmin" cookie for PHP >= 7.3
- issue #16966 Encode "#" to have the anchor part of the destination URL on SQL highlight terms URLs
- issue #17004 Fix PHP errors due to removed variable "innodb_file_format" on MariaDB >= 10.6.0 and MySQL >= 8.0.0
- issue #16842 Fixed missing password modes on PerconaDB
- issue #16947 Fix "Change login information" form not working
- issue #17004 Fix Advisor for MariaDB >= 10.5 because of removed "innodb_log_files_in_group" variable
- issue #17037 Fix change structure does not surface errors
- issue #17016 Fixed online Transaction, errors not reported on structure edit
- issue #17042 Fix SQL escaping bug on DB name with special chars on submit query with rollback option
- issue #17027 Better handle the display of sorted binary columns in results summary
- issue #16398 Quote non numeric values on parameterized queries
- issue Fixed duplicate HTML escaping on foreign keys select value modal
- issue #15370 Fixed edit routine UI incorrectly removes too many escape slashes
- issue #14631 Fix enum with comma produces incorrect search dropdown on search pages
- issue Fix gis visualization position and limit parameters have no effect
- issue #16995 Fix edit binary foreign key adds a 1 to the value on the selected value
- issue #13614 Fixed escaping the database names when granting privileges on tables
- issue #11834 Fixed adding a new user on "privileges" tab of a table with a database name using a "_" character
- issue #17033 Fixed scaling of line width and point size in GIS visualization
- issue #17054 Removed "DEL" character from generated random strings for Blowfish secret auto-generated by setup
- issue #17019 Fixed "Browse" button visible when creating a table from the database structure view
- issue #16804 Fixed numbers where left-aligned rather than right-aligned
- issue Fixed Metro theme text color for buttons in the browse table navigation bar
- issue #14796 Fix export Database page, UI prevents from exporting procedures only
- issue #15225 Fix Command+click on macOS opens links in same tab
- issue #17014 Fix column names in first row when importing from CSV where the first line contains column names
- issue Fix prevent scrolling the page when scrolling in GIS visualization
- issue Fix GIS visualization save file with a different label or column
- issue Fixed GIS saving image as png with a label
- issue Fixed if label is just the number zero, it was treated as no label in the OpenLayers map
- issue #17039 Fix unable to have 2FA working with a "pmadb" config value != phpmyadmin
- issue #17079 Fixed missing spatial functions in Insert/Edit page
- issue Fixed broken docs link after a FK data type mismatch error
- issue Fix don't add multiple OpenLayers maps, remove listeners on dispose on GIS visualization
- issue #14502 Uncheck the "ignore" checkbox when the user chooses a value in the foreign key list on Insert page
- issue #14502 Uncheck the "ignore" checkbox when the user saves the GIS value on Insert page
- issue #17018 Fixed cannot save data from GIS editor for spatial column on Insert page
- issue #17084 Fixed ErrorHandler not showing errors when phpMyAdmin session does not work at all
- issue #17062 Fixed pagination issues when working with identically named tables in separate databases
- issue #17046 Fix "Uncaught TypeError: htmlspecialchars() expects parameter 1 to be string, null given"
- issue #16942 Fix table Import with CSV using LOAD DATA LOCAL causes error "LOAD DATA LOCAL INFILE is forbidden"
- issue #16942 Fix auto-detection for "LOAD DATA LOCAL INFILE" LOCAL option
- issue #16067 Make select elements with multiple items resizable
- issue Fix the display of Indexes that use Expressions and not column names
- issue Allow to create the phpMyAdmin storage database using a different name than "phpmyadmin" using the interface
- issue #17092 Document that "$cfg['Servers'][$i]['designer_coords']" was removed in version 4.3.0
- issue #16906 Support special table names for pmadb storage table names
- issue #16906 Fix a caching effect on the feature list after creating the tables
- issue #16906 Better report errors when creating the pmadb or it's tables
- issue #16906 Create the pmadb tables using the names configured and not the default names
- issue #16906 Create the phpMyAdmin storage database using the configured "['pmadb']" name and not always "phpmyadmin"
- issue #16906 Prevent incorrect overriding of configured values after a pmadb fix
- issue #16906 Use the control connection to create the storage database and tables and not the user connection
- issue #16693 Fix can't see SQL after adding a new column
- issue #12753 Show table structure after adding a new column
- issue Fix a PHP notice when logging out
- issue #17090 Fix bbcode not rendered for error messages on setup
- issue #17198 Fix the database selection when the navigation tree is disabled
- issue #17228 Fixed copy to clipboard with NULL values gives non usable text
- issue #16746 Replace samyoul/u2f-php-server by code-lts/u2f-php-server
- issue #16005 Performance improvement on the Import and Export pages
- issue #17247 Fix triple HTML encoding
- issue #17259 Fix broken link in the Simulate DML query modal
- issue #16746 Update tcpdf dependency to ^6.4.4 for PHP 8.1 compatibility
- issue #16746 Update twig dependency to "^2.14.9 || ^3.3.5" for PHP 8.1 compatibility
- issue [security] Add configuration directive $cfg['Servers'][$i]['hide_connection_errors'] to allow hiding host names and other error details when login fails
- issue [security] Add configuration directive $cfg['URLQueryEncryption'] to allow encrypting senstive information in the URL
- issue [security] Fix a scenario where an authenticated user can disable two factor authentication (PMASA-2022-1)
- issue [security] Fix XSS and HTML injection attacks in the graphical setup page (PMASA-2022-2)
5.1.1 (2021-06-04)
- issue #13325 Fixed created procedure shows up in triggers and events and vice-versa
- issue Fixed adding an event shows an empty row
- issue #16706 Fixed a PHP error when visualizing a nullable geometry column
- issue Fixed a PHP type error when exporting triggers to ODF
- issue #16659 Fixed the Column Drop arrow to make it responsive
- issue #16677 Improved the Font size of an executed SQL query
- issue #16677 Fixed Metro theme DB tree background
- issue #16713 Fixed "PhpMyAdmin\Url::getFromRoute" PHP error for old config values
- issue #16713 Add a legacy fallback for the old config value of "$cfg['DefaultTabDatabase']" and others
- issue #16698 Fix relative fallback URL to './' instead of '/'
- issue Fixed Yaml export to quote strings even when they are numeric
- issue #16704 Fixed PHP type errors on the substring transformation
- issue #14026 Fixed error messages and conditions for MD5 and AES_* functions
- issue #16708 Fixed PHP "Uncaught TypeError: hash_hmac()" on double quick edit
- issue #16709 Fix TCPDF open_basedir issue due to internal guessing code from TCPDF
- issue #16729 Fixed the silencing error management for PHP >= 8.0
- issue #16604 Set back tables width like in 5.0 versions
- issue #16716 Fixed rename button disappears after a column drop on table structure page
- issue #15628 Fixed "JSON encoding failed: Malformed UTF-8 characters" when browsing data that uses binary to IP transformation
- issue #14395 Fixed display chart with timeline & series name column trigger JS error
- issue #16738 Fixed quick search submit is not working on multi server server > 1
- issue #16717 Fixed main drawer js call slowing down the page and remove the reflow effect
- issue Fixed a PHP notice "Undefined index: pred_username"
- issue #16744 Fixed "Uncaught TypeError: XMLWriter::writeAttribute()" on Designer SVG export
- issue Fixed an PHP undefined index notice on export
- issue #14555 Fixed JavaScript error when auto completion is open (upgraded CodeMirror to 5.60.0)
- issue #16647 Fixed preferences form not showing texts and not respecting TabsMode config
- issue Fixed escape_mysql_wildcards Twig filter
- issue Change text from "Null" to "NULL" on grid edit popup
- issue Translate a non translated string on a change password page
- issue Fix designer modal buttons sizes for pmahomme and bootstrap themes
- issue #16694 Fixed "Triggers" page not visible for user table specific privileges
- issue #14430 Fixed execute button is disabled for routines
- issue #16703 Fixed SQL option to Export specific rows from a table
- issue #16656 Fixed error messages are not always translated
- issue #16728 Fixed wrong SQL query built on table structure index for new column
- issue #16647 Fixed table search forms not showing texts and not respecting TabsMode config
- issue #16758 Fixed copy to clipboard feature not working on ja or zh_TW languages because of the non ascii colon
- issue #16601 Update tcpdf dependency to ^6.4.1
- issue #16770 Fixed a notice or warning, when clicking on Structure tab
- issue #16756 Fixed refresh UI on server status
- issue Fixed a PHP notice when searching for .git/commondir on the login page for users using ShowGitRevision
- issue Fixed reported PHP notice on export save template
- issue Fixed reported PHP warnings on server status page
- issue #15629 Fixed datetime decimals displayed (.00000) after edit
- issue #16780 Fixed new event shows an empty row
- issue #16765 Fixed new lines in text fields are doubled
- issue Fix "Connection" label always shown on table create, should be hidden like it's input
- issue #16773 Fix do not use cast as binary for an empty text value on edit button condition
- issue Fixed a JS error on a missing script on zoom search
- issue Added button style on the reset charts of zoom search
- issue Fixed number of rows not kept when changing sort by index value
- issue #16784 Fixed spacing between icons when using NavigationTreeDefaultTabTable2 configuration
- issue #16786 Fixed browser error when clicking the logo with NavigationLogoLink configuration
- issue Fixed a type error when getting the special schema links
- issue #16789 Fix create PHP code removes ; from SQL query on Structure snapshot
- issue #16791 Fixed "Undefined index table_schema" on special schema table
- issue Fixed "DESCRIBE FILES;" broken links in query results
- issue #16790 Fixed "Undefined index field_name" PHP error
- issue #16605 Fixed vertical alignment issue on tables for pmahomme theme
- issue #16798 Fix ServerConfigChecks: Link 'trusted proxies list' not terminated properly (translation)
- issue #16805 Fixed shortcut keys not working
- issue #16821 Fix "Show all rows" un-check checkbox creates a JS error if the page was reloaded
- issue Remove redundant jQuery Event Drag plugin
- issue Fix PHP type error on GIS nullable data
- issue Fix not working export to PNG, SVG, PDF on GIS visualization
- issue Fix float values type errors on GIS export to PNG, SVG, PDF
- issue #16792 Fixed URL generation by removing un-needed &amp; escaping for & char
- issue #16777 Fixed Non-UTF8 Primary Key text value edit row
- issue #16836 Fixed extra whitespaces in binary edit values causes a JS validation error message
- issue #15566 Support RTL mode on the Designer
- issue #16810 Fixed SQL query shown twice on drop column success
- issue #16404 Fixed JS password generation fails after a new user creation failure
- issue #16837 Fixed PHP error on execute query "create table event(...)"
- issue Fixed a PHP warning that was occuring on wrong chmod on config files
- issue Fixed a JS error on dismiss notification modal
- issue #16793 Upgrade CodeMirror to 5.61.0 to fix a JS error on scroll in SQL query box
- issue Fix password management for Percona Server lacking PASSWORD function
- issue Fixed "data is undefined" JS error
- issue Fixed 2 un-translated buttons on central columns edit
- issue #16810 Fixed SQL query shown twice on central columns actions
- issue #16771 Fixed PHP array export to work on very large datasets
- issue #16847 Fixed JSON export nullable binary PHP error
- issue #16847 Fixed JSON export text fields and binary data
- issue #14773 Fix exporting a raw query is not working
- issue #16734 Fixed memory limit reached, use SQL COUNT(*) instead of fetch and count results
- issue #16723 Fixed option to perform ALTER ONLINE is not available on edit of an existing column
- issue Add missing CSS style on "Filter" button on monitor results table header
- issue Fixed non working "Filter" button on monitor results table header
- issue #16420 Fixed single clicking on row starts editing even if GridEditing is set to double-click
- issue #16854 Fixed "Undefined index: SERVER_SOFTWARE" on very minimal PHP FPM setups
- issue #16863 Fixed replication setting up a replica is not working
- issue #16843 Fixed vertical alignment in Metro and pmahomme themes on user accounts overview
- issue Fixed "phpMyAdmin configuration storage" link on settings page warning
- issue #16871 Fixed PHP and JS errors on normalization steps
- issue Fixed CSS missing classes on normalization buttons
- issue #16437 Fixed sticky top position when using smaller screen sizes
- issue #16895 Fixed wrong table count on space separated numbers
- issue #16882 Fixed table delete resets count to 0
- issue #16892 Fixed current_timestamp() stringified on INSERT for date field
- issue #16911 Fixed PHP 8.1 "Method mysqli::get_client_info() is deprecated"
- issue Fix "array_fill(): Argument #2 ($count) must be of type int, string" for "$cfg['InsertRows']"
- issue #14130 Created new messages for U2F errors
- issue #16920 Fixed "Uncaught TypeError: PhpMyAdmin\Import::detectType()" on ODS import
- issue #16926 Fixed ODS import warning: Undefined array key "ods_empty_rows"
- issue #16888 Fixed JS error on renaming tables in saved Designer page
- issue #16504 Fixed create view dialog is too big and won't scroll (on small screens)
- issue #16931 Fixed php notice "Undefined index: utf8mb3" on MySQL 8.0.11+ servers with default utf8 server charset
5.1.0 (2021-02-24)
- issue #15350 Change Media (MIME) type references to Media type
- issue #15377 Add a request router
- issue Automatically focus input in the two-factor authentication window
- issue #15509 Replace gender-specific pronouns with gender-neutral pronouns
- issue #15491 Improve complexity of generated passwords
- issue #14909 Add a configuration option to define the 1st day of week
- issue #12726 Made user names clickable in user accounts overview
- issue #15729 Improve virtuality dropdown for MariaDB > 10.1
- issue #15312 Added an option to perform ALTER ONLINE (ALGORITHM=INPLACE) when editing a table structure
- issue Added missing 'IF EXISTS' to 'DROP EVENT' when exporting databases
- issue #15232 Improve the padding in query result tool links
- issue #15064 Support exporting raw SQL queries
- issue #15555 Added ip2long transformation
- issue #15194 Fixed horizontal scroll on structure edit page
- issue #14820 Move table hide buttons in navigation to avoid hiding a table by mistake
- issue #14947 Use correct MySQL version if the version is 8.0 or above for documentation links
- issue #15790 Use "MariaDB Documentation" instead of "MySQL Documentation" on a MariaDB server
- issue #15880 Change "Show Query" link to a button
- issue #13371 Automatically toggle the radio button to "Create a page and save it" on Designer
- issue #12969 Tap and hold will not dismiss the error box anymore, you can now copy the error
- issue #15582 Don't disable "Empty" table button after clicking it
- issue #15662 Stay on the structure page after editing/adding/dropping indexes
- issue #15663 show structure after adding a column
- issue #16005 Remove symfony/yaml dependency
- issue #16005 Improve performance of dependency injection system by removing yaml parsing
- issue #15447 Disable phpMyAdmin storage database checkbox on databases list
- issue #16001 Add autocomplete attributes on login form
- issue #13519 Add "Preview SQL" option on Index dialog box when creating a new table
- issue #15954 Fixed export maximal length of created query input is too small
- issue Redesign the server status advisor page
- issue #13124 Use same height for SQL query textarea and Columns select in SQL page
- issue #16005 Add a new vendor constant "CACHE_DIR" that defaults to "libraries/cache/" and store routing cache into this folder
- issue #16005 Warm-up the routing cache before building the release
- issue #16005 Use --optimize-autoloader when installing composer vendors before building the release
- issue #15992 Add back the table name to the printable version on "Structure" page
- issue #14815 Allow simplifying exported view syntax to only "CREATE VIEW"
- issue #15496 Add $cfg['CaptchaSiteVerifyURL'] for Google ReCaptcha siteVerifyUrl
- issue #14772 Add the password_hash PHP function as an option when inserting data
- issue #15136 Add a notice for Hex converter giving invalid results
- issue #16139 Use a textarea for JSON columns
- issue #16223 Make JSON input transformation editor less narrow
- issue #14340 Add a button on Export Page to show the SQL Query
- issue #16304 Add support for INET6 column type
- issue #16337 Fix example insert/update query default values
- issue #12961 Remove indexes from table relation
- issue #13557 Use a full list of functions instead of a separated one on insert/edit page "Function" selector
- issue #14795 Include routines in the export in a predictable order
- issue #16227 Fixed autocomplete is not working in case the table name is quoted by "`" symbols
- issue #15463 Force BINARY comparison when looking at privileges to avoid an SQL error on privileges tab
- issue #16430 Fixed Windows error message uses trailing / instead of \
- issue #16316 Added support for "SameSite=Strict" on cookies using configuration "$cfg['CookieSameSite']"
- issue #16451 Fixed AWS RDS IAM authentication doesn't work because pma_password is truncated
- issue #16451 Show an error message when the security limit is reached instead of silently trimming the password to avoid confusion
- issue #15001 Add back Login Cookie Validity setting to the features form
- issue #16457 Add config parameters to support third-party ReCaptcha v2 compatible APIs like hCaptcha
- issue #13077 Moved tools section to left on large devices (Bootstrap xl)
- issue #15711 Moved some buttons to left on large devices (Bootstrap xl)
- issue #15584 Add $cfg['MysqlSslWarningSafeHosts'] to set the red text black when ssl is not used on a private network
- issue #15652 Replace deprecated FOUND_ROWS() function call on "distinct values" feature
- issue Export blobs as hex on JSON export
- issue #16095 Fix leading space not shown in a CHAR column when browsing a table
- issue Make procedures/functions SQL editor both side scrollable
- issue #16407 Bump pragmarx/google2fa conflict to >8.0
- issue #14953 Added a rename Button to use RENAME INDEX syntax of MySQL 5.7 (and MariaDB >= 10.5.2)
- issue #16477 Fixed no Option to enter TABLE specific permissions when the database name contains an "_" (underscore)
- issue #16498 Fixed empty text not appearing after deleting all Routines
- issue #16467 Fixed a PHP notice "Trying to access array offset on value of type null" on Designer PDF export
- issue #15658 Fixed saving UI displayed columns on a non database request fails
- issue #16495 Fix drop tables checkbox is above the checkbox for foreign keys
- issue #16485 Fix visual query builder missing "Build Query" button
- issue #16565 Added 'IF EXISTS' to 'DROP EVENT' when updating events to avoid replication issues
- issue Removed metro fonts that where Apache-2.0 files that are incompatible with GPL-2.0
- issue #16464 Made the relation view default to the current database when creating relations
- issue #16463 Fixed 'REFERENCES' privilege checkbox's title on new MySQL versions and on MariaDB
- issue #16405 Added jest as a Unit Testing tool for our javascript code
- issue #16252 Fixed the too small font size when editing rows (textareas)
- issue #16585 Fixed BLOB to JPG transformation PHP errors
- issue Made the console setup async to avoid blocking the page render
- issue #16429 Use PHP 8.0 fixed version (commit) for TCPDF
- issue #16005 Major performance improvements on browsing a lot of rows
- issue #16595 Fixed editing columns having a `_` in their name in specific conditions
- issue #16608 Fix "Sort by key" restore auto saved value
- issue #16611 Fixed unable to add tables to rename aliases twice on Export
- issue #16621 Fixed link HTML messed up in Advisor
- issue #16622 Fixed Advisor formatting incorrect for long_query_time notice
- issue #15389 Fixed reset current page indicator after deleting all rows to current page and not page 1
- issue #15997 Fixed auto save query
- issue #15997 Made auto saved query database or database+table independent
- issue #16641 Fixed query generation that was allowing JSON to have a length
- issue #15994 Fixed the selected value detection for "on update current_timestamp"
- issue #16614 Fixed PHP 8.0 dataseek offset call to the MySQLI extension
- issue #16662 Fixed Uncaught TypeError on "delete" button click of a database search results page
- issue Fixed Undefined index: selected_usr when the user tried to delete no selected user
- issue #16657 Fixed the QBE interface when the configuration storage is not enabled
- issue #16479 Fix our Selenium test-suite
- issue #16669 Fixed table search modal for BETWEEN
- issue #16667 Fixed LIKE and TINYINT in search not working properly
- issue #16424 Fixed numerical search in table and zoom
- issue Improve the version handling (new Version class) and add a VERSION_SUFFIX for vendors
- issue #14494 Fix uncaught TypeError when editing partitioning
- issue #16525 Fix PHP 8.0 failing tests when comparing 0 to ''
- issue #16429 Fixed PHP 8.0 errors on preg_replace and operand types
- issue #16490 Fixed PHP 8.0 function libxml_disable_entity_loader() is deprecated
- issue #16429 Fixed failing unit tests on PHP 8.0
- issue #16609 Fixed Sql.rearrangeStickyColumns is not a function
5.0.4 (2020-10-15)
- issue #16245 Fix failed Zoom search clears existing values
- issue Fixed a PHP error when reporting a particular JS error
- issue #16326 Fixed latitude and longitude swap for geometries in edit mode
- issue #16032 Fix CREATE TABLE not being tracked when auto tracking is enabled
- issue #16397 Fix compatibility problems with older PHP versions (also issue #16399)
- issue #16396 Fix broken two-factor authentication
5.0.3 (2020-10-09)
- issue #15983 Require twig ^2.9
- issue Fix option to import files locally appearing as not available
- issue #16048 Fix to allow NULL as a default bit value
- issue #16062 Fix "htmlspecialchars() expects parameter 1 to be string, null given" on Export xml
- issue #16078 Fix no charts in monitor when using a decimal separator ","
- issue #16041 Fix IN(...) clause doesn't permit multiple values on "Search" page
- issue #14411 Support double tap to edit on mobile
- issue #16043 Fix php error "Use of undefined constant MYSQLI_TYPE_JSON" when using the mysqlnd extension
- issue #14611 Fix fatal JS error on index creation after using Enter key to submit the form
- issue #16012 Set "axis-order" to swap lon and lat on MySQL >= 8.1
- issue #16104 Fixed overwriting a bookmarked query causes a PHP fatal error
- issue Fix typo in a condition in the Sql class
- issue #15996 Fix local setup doc links pointing to a wrong location
- issue #16093 Fix error importing utf-8 with bom sql file
- issue #16089 2FA UX enhancement: autofocus 2FA input
- issue #16127 Fix table column description PHP error when ['DisableIS'] = true;
- issue #16130 Fix local documentation links display when a PHP extension is missing
- issue Fix some twig code deprecations for php 8
- issue Fix ENUM and SET display when editing procedures and functions
- issue Keep full query state on "auto refresh" process list
- issue Keep columns order on "auto refresh" process list
- issue Fixed editing a failed query from the error message
- issue #16166 Fix the alter user privileges query to make it MySQL 8.0.11+ compatible
- issue Fix copy table to another database when the nbr of DBs is > $cfg['MaxDbList']
- issue #16157 Fix relations of tables having spaces or special chars not showing in the Designer
- issue #16052 Fix a very rare JS error occuring on mousemove event
- issue #16162 Make a foreign key link clickable in a new tab after the value was saved and replaced
- issue #16163 Fixed a PHP notice "Undefined index: column_info" on views
- issue #14478 Fix the data stream when exporting data in file mode
- issue #16184 Fix templates/ directory not found error
- issue #16184 Remove chdir logic to fix PHP fatal error "Uncaught TypeError: chdir()"
- issue Support for Twig 3
- issue Allow phpmyadmin/twig-i18n-extension ^3.0
- issue #16201 Trim spaces for integer values in table search
- issue #16076 Fixed cannot edit or export TIMESTAMP column with default CURRENT_TIMESTAMP in MySQL >= 8.0.13
- issue #16226 Fix error 500 after copying a table
- issue #16222 Fixed can't use the search page when the table name has special characters
- issue #16248 Fix zoom search is not performing input validation on INT columns
- issue #16248 Fix javascript error when typing in INT fields on zoom search page
- issue Fix type errors when using saved searches
- issue #16261 Fix missing headings on modals of "User Accounts -> Export"
- issue #16146 Fixed sorting did not keep the selector of number of rows
- issue #16194 Fixed SQL query does not appear in case of editing view where definer is not you on MySQL 8
- issue #16255 Fix tinyint(1) shown as INT on Search page
- issue #16256 Fix "Warning: error_reporting() has been disabled for security reasons" on php 7.x
- issue #15367 Fix "Change or reconfigure primary server" link
- issue #15367 Fix first replica links, start, stop, ignore links
- issue #16058 Add "PMA_single_signon_HMAC_secret" for signon auths to make special links work and udate examples
- issue #16269 Support ReCaptcha v2 checkbox width "$cfg['CaptchaMethod'] = 'checkbox';"
- issue #14644 Use Doctum instead of Sami
- issue #16086 Fix "Browse" headings shift when scrolling
- issue #15328 Fix no message after import of zipped shapefile without php-zip
- issue #14326 Fix PHP error when exporting without php-zip
- issue #16318 Fix Profiling doesn't sum the number of calls
- issue #16319 Fixed a Russian translation mistake on search results total text
- issue #15634 Only use session_set_cookie_params once on PHP >= 7.3.0 versions for single signon auth
- issue #14698 Fixed database named as 'New' (language variable) causes PHP fatal error
- issue #16355 Make textareas both sides resizable
- issue #16366 Fix column definition form not showing default value
- issue #16342 Fixed multi-table query (db_multi_table_query.php) alias show the same alias for all columns
- issue #15109 Fixed using ST_GeomFromText + GUI on insert throws an error
- issue #16325 Fixed editing Geometry data throws error on using the GUI
- issue [security] Fix XSS vulnerability with the transformation feature (PMASA-2020-5)
- issue [security] Fix SQL injection vulnerability with search feature (PMASA-2020-6)
5.0.2 (2020-03-20)
- issue Fixed deprecation warning "implode(): Passing glue string after array is deprecated." function on export page
- issue #15767 Fixed can not copy user account since 5.0 - "error #1133"
- issue #15772 Fixed error code 500 during pagination of the tables in a database
- issue #16009 Fix php error "Trying to access array offset on value of type null" on column distinct values feature
- issue #15741 Fix fatal javascript error on clicking "Pick from Central Columns"
- issue #15773 Fixed a view named "views" adds an expand button
- issue #15432 Fixed names of the pages in the designer should be unique
- issue #14310 Fixed column selector "See more" removes "Preview SQL" and "Save" area
- issue Fixed wrong jQuery function call in table search page
- issue #15761 Fix uncaught TypeError when using "$cfg['ServerDefault'] = 0;"
- issue #15780 Fixed unexpected UI of action links (text only mode)
- issue #15674 Replace twig/extensions with phpmyadmin/twig-i18n-extension
- issue #15799 Change location of profiling state documentation to fix column ordering
- issue #15720 Fix designer adding all available tables to a designer page after adding a new relationship
- issue #15791 Replace facebook/webdriver by php-webdriver/webdriver
- issue #15802 Removed SET AUTOCOMMIT=0 from SQL export
- issue #15818 Fix table borders missing on theme original since 5.0.0
- issue #13864 Fix ENUM's radiobuttons reset on "Continue insertion with" changes
- issue #15811 Fixed browse foreign values doesn't show a modal with grid edit
- issue #15817 Fix "new table" layout issue on original theme
- issue #15798 Fixed not needed prompt before abandoning changes on SQL tab after only changing a checkbox
- issue #15833 Fix php TypeError when submitting unchanged data
- issue Fix php notice "Trying to access array offset on value of type bool" on Designer
- issue #13326 Added integer validations on search page
- issue #15200 Fixed server-side HTTPS detection misses support for Forwarded HTTP Extension (RFC 7239)
- issue #15831 Fixed DB names starting with "b" being cut off in <option>, User account page
- issue #15850 Fixed display content from "information_schema.PROCESSLIST"
- issue #15836 Fixed "has no type" error on export and import pages for "Chinese traditional" users
- issue #15863 Fixed designer move menu icon not changing directions and tables menu list resize button
- issue #15854 Fixed black borders for full screen mode on Designer
- issue #15899 Fix "Uncaught TypeError: mb_strtoupper()" on the relational view of a view
- issue Fixed some php uncaught errors and notices on user missing extension
- issue #15926 Fixed PhpMyAdmin\Core::getRealSize('8000M') returns a float instead of an int
- issue #15410 Fixed auto increment reset issue where the last value of AI was saved an could destroy the "good" value
- issue #15187 Fixed editing a row and using 'insert as new row' uses primary key 0 instead of NULL
- issue #15877 Fixed php error "preg_match() expects parameter 2 to be string, null given" on some specific tables
- issue #15795 Fix broken link on "MySQL said" error message
- issue #15781 Fix illegal string offset error on structure page of 'information_schema' database
- issue #15745 Fix version 5.0.1 suggests 4.9.4 as latest stable version
- issue #15958 Fix uncaught TypeError when sorting database tables by size or by rows
- issue #15830 Fix strftime issue on windows for Japanese users on "Structure" tab
- issue Windows testsuite fixes
- issue #15879 Added missing CSS class on "simulate query" button
- issue #15401 Fixed php notice "Undefined index HMAC_secret" for users upgrading phpMyAdmin without a log-out
- issue #15810 Fixed unexpected heading on add a new procedure, trigger, function, routine modals
- issue #15970 Removed wrong html a tag on "Replication status" header
- issue Add missing css classes on some buttons
- issue #15937 Make modals draggability/expand (down) work after a screen zoom change
- issue Fix php notice "Undefined index: on_delete" while creating a foreign key
- issue #15876 Fixed select "IN (...)" is a simple select instead of a multiple select
- issue Fix maxlength for User and Host on replication add user form
- issue #15282 Fixed MySQL 8.0 password syntax error when creating a replication user
- issue #15986 Fixed php fatal error "Uncaught TypeError: array_flip() expects parameter 1 to be array, null given"
- issue Fixed php fatal error "Uncaught TypeError: htmlspecialchars() expects parameter 1 to be string, int given"
- issue Support phpunit 9.0
- issue Fix error in NavigationTree where $key might be sent as an int instead of a str to urlencode
- issue #16022 Fix uncaught TypeError on browse foreigners
- issue Fix failure if relational display field value is NULL - "Display column for relationships"
- issue #16033 Remove vendor bin files from non source version of phpMyAdmin
- issue #15898 [security] Fix escape tbl_storage_engine argument used on tbl_create.php
- issue #15224 Don't fire keyboard shortcuts while SQL query area is focused (on a mobile for example)
- issue [security] Fix SQL injection with certain usernames (PMASA-2020-2)
- issue [security] Fix SQL injection in particular search situations (PMASA-2020-3)
- issue [security] Fix SQL injection and XSS flaw (PMASA-2020-4)
- issue Deprecate "options" for the external transformation; options must now be hard-coded along with the program name directly in the file.
5.0.1 (2020-01-07)
- issue #15719 Fixed error 500 when browsing a table when $cfg['LimitChars'] used a string and not an int value
- issue #14936 Fixed display NULL on numeric fields has showing empty string since 5.0.0
- issue #15722 Fix get Database structure fails with PHP error on replicated server
- issue #15723 Fix can't browse certain tables since 5.0.0 update
- issue Prevent line wrap in DB structure size column
- issue Remove extra line break from downloaded blob content
- issue #15725 Fixed error 500 when exporting - set time limit when $cfg['ExecTimeLimit'] used a string and not an int value
- issue #15726 Fixed double delete icons on enum editor
- issue #15717 Fixed warning popup not dissapearing on table stucture when using actions without any column selection
- issue #15693 Fixed focus of active tab is lost by clicking refresh option on browse tab
- issue #15734 Fix Uncaught TypeError: http_build_query() in setup
- issue Fix double slash in path when $cfg['TempDir'] has a trailing slash
- issue #14875 Fix shp file import tests where failing when php dbase extension was enabled
- issue #14299 Fix JS error "PMA_makegrid is not defined" when clicking on a table from the "Insert" tab opened in a new tab
- issue #15351 Fixed 2FA setting removed each time the user edits another configuration setting
- issue [security] Fix SQL injection vulnerability on the user accounts page (PMASA-2020-1)
5.0.0 (2019-12-26)
- issue #13896 Drop support for PHP 5.5, PHP 5.6, PHP 7.0 and HHVM
- issue #14007 Enable columns names by default for CSV exports
- issue #13919 Remove font size feature
- issue #12373 Add Metro theme
- issue #14155 Add move columns preview SQL button
- issue #14296 Enable strict mode in PHP files
- issue #13627 Increase field width for editing varchar fields
- issue #12603 Show warning for users with the default values for controluser and controlpass
- issue #14589 Fix rendering of column comments in Safari, improve display in all browsers
- issue #14330 New features for csv import plugin
- issue #14417 Automatically add index while editing an existing row and setting auto increment
- issue #13057 Add export option to drop user security definers from views
- issue #14404 Drop view and or replace added to exporting view
- issue #14594 Database "Search" selects all tables by default
- issue #12158 Auto expand the single database
- issue #13067 Inconsistency with submit buttons
- issue #14683 Improper message in Show Hidden Navigation Tree Items
- issue #14695 Remove unlabeled default collation from the bottom of the database list; this information is available elsewhere
- issue #14677 Security confirm() before running UPDATE statement without WHERE condition
- issue #13023 Show errors at the bottom of the page and add copy query button for errors in processing sql queries
- issue #14633 Use Sass instead of PHP to compile CSS
- issue #14765 Add initial support for Bootstrap 4
- issue #14829 Change table column comment field from input to textarea
- issue #14725 Console: ctrl+l clear line and ctrl+u clear console
- issue #14837 Use charset 'windows-1252' when format is MS Excel
- issue #15030 Move 'More settings' link from 'Appearance settings' to 'General settings'
- issue #15029 Remove the redundant 'i' help/tool tip in page settings "Query History Length" area
- issue #13424 Importing CSV now uses file name as the table name instead of 'TABLE #'
- issue #14926 Add an Edit link for each view in tables list
- issue #14890 Display column details in navigation bar
- issue #14977 Add title for group in navigation bar
- issue #14927 Show InnoDB table overhead (free space)
- issue #15072 Add 'Close' button to the Monitor Instructions modal
- issue #15174 Improved filter method in server variables page
- issue #15266 Add an external dependency injection system
- issue #15350 Change MIME type references to Media (MIME) type
- issue Fixed url.php crashing because it's not loading the DatabaseInterface service
- issue #15540 Fixed uncaught TypeError: htmlspecialchars() in NavigationTree
- issue Fix twig deprecation notices for php 8.0
- issue #15435 Fix ReCAPTCHA couldn't find user-provided function: Functions.recaptchaCallback
- issue #15623 Fix width of picker modal and remove date picker for int fields
- issue #14732 Fixed can't rename primary key with auto increment
- issue #15677 Fix show process-list triggers a php exception
- issue #15697 Fix uncaught php error: "Call to a member function get() on null" in db_export.php when exporting a table from the list
4.9.9 (not yet released)
- issue #17305 Fix syntax error for PHP 5
- issue #17307 Fix hide_connection_errors being undefined when a controluser is set
4.9.8 (2022-01-20)
- issue #14321 Display a correct error page when "$cfg['Servers'][$i]['SignonURL']" is empty for auth_type=signon
- issue #14321 [security] Remove leaked HTML on signon page redirect before login for auth_type=signon
- issue [security] Add configuration directive $cfg['Servers'][$i]['hide_connection_errors'] to allow hiding host names and other error details when login fails
- issue [security] Add configuration directive $cfg['URLQueryEncryption'] to allow encrypting senstive information in the URL
- issue [security] Fix a scenario where an authenticated user can disable two factor authentication
4.9.7 (2020-10-15)
- issue #16397 Fix compatibility problems with older PHP versions (also issue #16399)
- issue #16396 Fix broken two-factor authentication
4.9.6 (2020-10-09)
- issue [security] Fix XSS vulnerability with the transformation feature (PMASA-2020-5)
- issue [security] Fix SQL injection vulnerability with search feature (PMASA-2020-6)
4.9.5 (2020-03-20)
- issue [security] Fix SQL injection with certain usernames (PMASA-2020-2)
- issue [security] Fix SQL injection in particular search situations (PMASA-2020-3)
- issue [security] Fix SQL injection and XSS flaw (PMASA-2020-4)
- issue Deprecate "options" for the external transformation; options must now be hard-coded along with the program name directly in the file.
4.9.4 (2020-01-07)
- issue #15724 Fix 2FA was disabled by a bug
- issue [security] Fix SQL injection vulnerability on the user accounts page (PMASA-2020-1)
4.9.3 (2019-12-26)
- issue #15570 Fix page contents go underneath of floating menubar in some cases
- issue #15591 Fix php notice 'Undefined index: foreign_keys_data' on relations view when the user has column access
- issue #15592 Fix php warning "error_reporting() has been disabled for security reasons"
- issue #15434 Fix middle click on table sort column name shows a blank page
- issue Fix php notice "Undefined index table_create_time" when setting displayed columns on results of a view
- issue #15571 Fix fatal error when trying to edit row with row checked and button under the table
- issue #15633 Fix designer set display field broken for php 5.x versions
- issue #15621 Support CloudFront-Forwarded-Proto header for Amazon CloudFront proxy
- issue Fix php 8.0 php notices - Undefined index on login page
- issue #15640 Fix php 7.4 error when trying to access array offset on value of type null on table browse
- issue #15641 Fix replication actions where broken (start slave, stop slave, reset, ...)
- issue #15608 Fix DisableIS is broken when with controluser configured (database list broken)
- issue #15614 Fix undefined offset on index page for MySQL 5.7.8 (server charset)
- issue #15692 Fix JavaScript error when user has not enough privilege to view query statistics.
- issue #14248 Fixed date selection in search menu missing higher Z-index value
- issue Fix Uncaught php TypeError on php 8.0 when adding a column to table create form
- issue #15682 Fix calendar not taking current time as default value
- issue #15636 Fix php error trying to access array offset on value o type null on replication GUI
- issue #15695 Fix input field for the time in datetime picker is disabled
4.9.2 (2019-11-21)
- issue #14184 Change the cookie name from phpMyAdmin to phpMyAdmin_https for HTTPS, fixes many "Failed to set session cookie" errors
- issue #15304 Fix ssl_use php error
- issue #14804 Fix undefined index: ssl_* variables
- issue #14245 Fix mysql 8.0.3 and above fails on advisor
- issue #15499 Fix unparenthesized php deprecation
- issue #15482 Fix URL encoding plus sign (+) in the table or DB name when configuring foreign keys
- issue #14898 Fixed bottom table in list in left panel blocked by horizontal scroll bar
- issue #15161 Fix text area overflows its parent element on "Query" page
- issue #15511 Fixed exporting users after a delete will delete all selected users on "Users" page
- issue #14598 Fixed checking referencial integrity on "Operations" page
- issue #14433 Fix "You do not have privileges to manipulate with the users!" on root superadmin
- issue #15391 Fix GIS polygon of a geometry field is not drawn on "GIS visualization"
- issue #15311 Fix adjust privileges on copy database fails with MariaDB
- issue #15477 Fix display referential integrity check for InnoDB
- issue #15236 Support phpunit 8 in our test suite to help packaging phpMyAdmin on Debian
- issue #15522 Fix missing image error fills logs, removed ic_b_info icon from icon list
- issue #15537 Fixed some issues with the sort by key selectors
- issue #15546 Fix operators precedence in DatabaseInterface class
- issue #14906 Test test suite on 32-bit systems
- issue Fix Long2IP transformation issue with PHP 7.1
- issue #14951 Fix moving columns with DEFAULT NULL doesn't work on MariaDB 10.2+
- issue #14951 Fix moving columns with INT AND DEFAULT CURRENT_TIMESTAMP doesn't work on MariaDB
- issue #12241 Fixed table alias is removed when exporting a query
- issue #15316 Fixed cross join clause is removed on export
- issue #14809 Fix error "is_uploaded_file() expects parameter 1 to be string" when inserting blobs from files
- issue #15127 Fix white square when refreshing designer or browsing other pages
- issue #13912 Detect when phpMyAdmin storage tables are not accessible, help users browse corrupt DBs
- issue #15465 Display profiling when query outputs no rows
- issue Fix setting and removing display field on Designer
- issue Added a warning when trying to set a display field on Designer and configuration storage is not setup
- issue #15327 Fix shift-click in Export misses a checkbox
- issue [security] Fix improperly sanitized data when showing the Git branch (thanks to Ali Hubail for this report)
- issue [security] Fix security weaknesses in Designer feature,including a flaw where an attacker could trigger an SQL injection attack (PMASA-2019-5)
4.9.1 (2019-09-20)
- issue #15313 Added support for Twig 2
- issue #15315 Fix cannot edit or export column with default CURRENT_TIMESTAMP in MySQL >= 8.0.13
- issue Fix a TypeError in Import class with PHP 8
- issue #14270 Fix Middle-click on foreign key link broken
- issue #14363 Fix broken relational links in tables
- issue #14987 Fix weird error for empty collation
- issue #15334 Fix export of GIS visualisation not working (PNG, PDF, SVG)
- issue #14918 Use hex for the phpMyAdmin session token
- issue Added GB18030 Chinese collations description
- issue Added Russian, Swedish, Slovak and Chinese UCA 9.0.0 collations description
- issue Added description for the _ks (kana-sensitive) collation suffix
- issue Added description for the _nopad (NO PAD) collation suffix
- issue #15404 Remove array/string curly braces access
- issue #15427 Fixed "FilterLanguages" option does not work (configuration)
- issue #15202 Fixed creating user with single quote in password results in no password user
- issue #14950 Fixed left database overview "add column" triggers error
- issue #15363 Fix remove unexpected quotes on text fields (structure and insert)
- issue Fix NULL wrongly checked on field change
- issue #15388 Fix allow to rollback an empty statement
- issue #14291 Fixed incorrect linkage from one table's value to another table
- issue #15446 Fix tables added from other databases are not collapsing in the designer section
- issue #14945 Fix designer page save fails if dB name contains period
- issue Display an error when trying to import in designer a table that's already imported
- issue Fix many bugs when adding new tables to designer
- issue Update CodeMirror to v5.48.4
- issue Update jQuery Migrate to v3.1.0
- issue Update jQuery Validation to v1.19.1
- issue Update jQuery to v3.4.1
- issue Update js-cookie to v2.2.1
- issue Remove fieldset closing tag when setting global privileges
- issue #15425 Fix backslash in column name resulting an error in editing
- issue #15380 Fix Status - Advisor error
- issue #15439 Fix designer page status not updated when added a new table from another database
- issue #15440 Fix page number is not being updated in the URL after saving a designer's page
- issue Fix reloading a designer's page
- issue Fix designer full screen mode button and text stuck when exiting full-screen mode
- issue Reduced possibility of causing heavy server traffic between the database and web servers
- issue Fix a situation where a server could be deleted while an administator is using the setup script
4.9.0.1 (2019-06-04)
- issue #14478 phpMyAdmin no longer streams the export data
- issue #14514 Tables with SYSTEM VERSIONING show up as views instead of tables
- issue #14515 Values cannot be edited in SYSTEM VERSIONING tables with INVISIBLE timestamps
- issue Fix header icon on server plugins page
- issue #14298 Fixed error 500 on MultiTableQuery page when a empty query is passed
- issue #14402 Fixed fatal javascript error while adding index to a new column
- issue #14896 Fixed issue with plus/minus icon when refreshing an expanded database
- issue #14922 Fixed json encode error in export
- issue #13975 Fixed missing query time in German (fix decimal number format issue)
- issue #14503 Fixed JavaScript events not activating on input (sql bookmark issue)
- issue #14898 Fixed Bottom table is blocked in database list (left panel)
- issue #14425 Fixed Null Checkbox automatically unmarked
- issue #14870 Display correct date and time in Zip files
- issue #14763 Fixed the loading symbol not appearing when refreshing the navigation
- issue #14607 Count rows only if needed
- issue #14832 Show Designer combo boxes when adding a constraint
- issue #14948 Fix change password is not showing password strength difference at the second attempt
- issue #14868 Fix edit view
- issue #14943 Fixed loading Forever when creating new view without filling any field
- issue #14843 Fix Bookmark::get() id matching SQL
- issue #14734 Fixed invalid default value for bit field
- issue #14311 Fixed undefined index in setup script
- issue #14991 Fixed TypeError in GIS editor
- issue Fixed GIS data editor for multi server setup
- issue #14312 Fixed type error in setup script when adding new server
- issue #14053 Fix missed padding on query results
- issue #14826 Fixed javascript error PMA_messages is not defined
- issue Show error message if config-set fails and not "loading..." forever
- issue #14359 Prevent multiple error modals, and error-report request spamming from script
- issue Fixed error reporting javascript errors on multi server setup
- issue Fixed wrong property name on TableStructureController
- issue #14811 Fix SHOW FULL TABLES FROM when a table is locked
- issue #14916 Fix bug when creating or editing views
- issue #14931 Fixed php error when using a query like SELECT 1 INTO @a; SELECT @a; in inline query edit
- issue #15074 Make the server logo visible on theme "original"
- issue #15077 Fixed incorrect page numbers
- issue #14205 Fixed "No tables found in database" when you delete all tables from last page
- issue #14957 Virtuality is not selected when editing generated column (added virtuality(stored) option for mariadb)
- issue #14853 Insert page should not allow entering things into virtual columns
- issue #15110 Fixed TypeError e.preventDefaulut is not a function
- issue #15115 Improved label in Settings export, clarifying that it's a JSON file
- issue #14816 Fixed [designer] Cannot read property 'style' of null
- issue Fixed [designer] Add new tables with database/table list modal
- issue Fixed query format on multi server setup
- issue Fixed remove partitioning on multi server setup
- issue Fixed normalization
- issue Fixed 'RESET SLAVE' button on replication slave
- issue Fixed sending a php error report on multi server setup
- issue Fixed downloading of monitor parameters for IE 11, Edge, Chrome and others
- issue #15141 Fixed php notice Undefined index: designer_settings
- issue #12729 Fixed sticky table header over dropdown menu
- issue #15140 Fixed edit link does not work on failed insert
- issue #14334 Fixed export table structure shows rows fields
- issue #15010 Fixed empty SQL preview modal on tbl_relation
- issue #14673 Fixed innodb & MySQL 8: DYNAMIC & COMPRESSED ROW_FORMAT missing
- issue Fixed empty success message when adding a new INDEX from left panel
- issue #15150 Fixed generate password hidden on second open of change password modal
- issue Fixed import XML data with leading zeros
- issue #15036 Fixed missing input fields checks for MaxSizeForInputField
- issue #15119 Fixed uninterpreted HTML on Settings->Export page
- issue #15159 Fixed missing query time and database in console
- issue #13713 Fixed column comments in the floating table header
- issue #15177 Fixed label alignment on login page
- issue #15210 Fixed a typo in the english name of the Albanian language
- issue Fixed issue when resetting charset in import.php
- issue #14460 Fixed forms where submitted multiple times on CTRL + ENTER
- issue #15038 Fixed console height was allowing a negative values
- issue #15219 Fixed 'No Password' option does not switch automatically to 'Use Text Field' in add user account
- issue Fixed importing the exported config on Server status monitor page
- issue #15228 Fixed php notice 'Undefined index: foreign_keys_data' on designer when the user has column access
- issue #12900 Fixed designer page saving gives error when configuration storage is not set up
- issue #15229 Fixed php notice, added support for 'DELETE HISTORY' table privilege (MariaDB >= 10.3.4)
- issue #14527 Fixed import settings function not working
- issue #14908 Fixed uninterpreted HTML on Settings->Import (missing data error descriptions)
- issue #14800 Fixed status->Processes doesn't show full query process list page
- issue #14833 Fixed sort by Time not working in process list page
- issue #14982 Fixed setting "null" keep an "enum" value
- issue #14401 Fixed insert rows keypress Enter behavior
- issue #15146 Fixed error reports can not be sent because they are too large
- issue #15205 Fixed useless backquotes on sql preview modal when deleting an index
- issue #13178 Fixed issues with uppercase table and database names (lower_case_table_names=1)
- issue #14383 Fixed warning when browsing certain tables (GIS data)
- issue #12865 Fixed MySQL 8.0.0 issues with GIS display
- issue #15059 Fixed "Server charset" in "Database server" tab showing wrong information
- issue #14614 Fixed mysql error "#2014 - Commands out of sync; you can't run this command now" on sql query
- issue #15238 Fixed phpMyAdmin 4.8.5 doesn't show privileges of procedures (raw html displayed instead)
- issue #13726 Fixed can not copy user on Percona Server 5.7
- issue #15239 Fixed javascript error while fetching latest version info and switching pages
- issue #14301 Fixed javascript error when editing a JSON data type column
- issue #15240 Fixed apply a Settings form with errors shows a JSON response after using return back
- issue #15043 Fixed multiple errors printing on Settings page
- issue #15037 Fixed unexpected behavior of reset button on Settings
- issue #15157 Fixed 'Settings' tab not marked as active when browsing 2FA settings
- issue #14934 Fixed all fields readonly on Edit/Insert screens
- issue #14588 Fixed export of geometry objects, GIS objects are now exported as hex
- issue #14412 Better handling of errors with Signon authentication type
- issue Added support for AUTO_INCREMENT when using ROCKSDB, on Operations page
- issue #15276 Fixed partitioning is missing in Structure page UI (MySQL 8.0)
- issue #14252 Fixed DisableIS and database tree list (new database missing when refreshing the list)
- issue #14621 Removed "Propose table structure" on MySQL 8.0
- issue Fixed editing of virtual columns on PerconaDB
- issue #13854 Fixed column options are ignored for GENERATED/VIRTUAL/STORED columns
- issue #15262 Fixed incorrect display of charset column (raw html)
- issue Added explicit parentheses in nested ternary operators
- issue #15287 Fix auto_increment field is too small
- issue #15283 Fix tries to change collation on views when changing collation on all tables/fields
- issue Fixed empty PMA_gotoWhitelist JavaScript array
- issue #15079 Fixed responsive behaviour of instruction dialog box
- issue #10846 Fixed javascript error when renaming a table
- issue Updated sql-parser to version 4.3.2
- issue [security] SQL injection in Designer (PMASA-2019-3)
- issue [security] CSRF attack on 'cookie' login form (PMASA-2019-4)
4.8.5 (2019-01-25)
- issue Developer debug data was saved to the PHP error log
- issue #14217 Fix issue when adding user on MySQL 8.0.11
- issue #13788 Exporting a view structure based on another view with a sub-query throws no database selected error
- issue #14635 Fix PHP error in GitRevision, error in processing request, error code 200
- issue #14787 Cannot execute stored procedure
- issue Add Burmese language
- issue #14794 Not responding to click, frozen interface, plugin Text_Plain_Sql error
- issue #14786 Table level Operations functions missing
- issue #14791 PHP warning, db_export.php#L91 urldecode()
- issue #14775 Export to SQL format not available for tables
- issue #14782 Error message shown instead of two-factor QR code when adding 2fa to a user
- issue [security] Arbitrary file read/delete relating to MySQL LOAD DATA LOCAL INFILE and an evil server instance (PMASA-2019-1)
- issue [security] SQL injection in Designer (PMASA-2019-2)
--- Older ChangeLogs can be found on our project website ---
https://www.phpmyadmin.net/old-stuff/ChangeLogs/

2
README
View File

@ -1,7 +1,7 @@
phpMyAdmin - Readme
===================
Version 5.2.1
Version 5.2.2
A web interface for MySQL and MariaDB.

View File

@ -8,16 +8,16 @@ https://www.phpmyadmin.net/
Code status
-----------
.. image:: https://github.com/phpmyadmin/phpmyadmin/workflows/Run%20tests/badge.svg?branch=master
.. image:: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/tests.yml/badge.svg?branch=master
:alt: Testsuite
:target: https://github.com/phpmyadmin/phpmyadmin/actions
:target: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/tests.yml?query=branch%3Amaster
.. image:: https://github.com/phpmyadmin/phpmyadmin/workflows/Run%20selenium%20tests/badge.svg?branch=master
:alt: Selenium tests
:target: https://github.com/phpmyadmin/phpmyadmin/actions
.. image:: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/test-selenium.yml/badge.svg?branch=master
:alt: End-to-End tests
:target: https://github.com/phpmyadmin/phpmyadmin/actions/workflows/test-selenium.yml?query=branch%3Amaster
.. image:: https://readthedocs.org/projects/phpmyadmin/badge/?version=latest
:target: https://docs.phpmyadmin.net/en/latest/
.. image:: https://readthedocs.org/projects/phpmyadmin/badge/?version=master
:target: https://docs.phpmyadmin.net/en/master/
:alt: Documentation build status
.. image:: https://hosted.weblate.org/widgets/phpmyadmin/-/master/svg-badge.svg
@ -40,7 +40,7 @@ Code status
:alt: Type coverage
:target: https://shepherd.dev/github/phpmyadmin/phpmyadmin
.. image:: https://badge.stryker-mutator.io/github.com/phpmyadmin/phpmyadmin/master
.. image:: https://img.shields.io/endpoint?url=https://badge-api.stryker-mutator.io/github.com/phpmyadmin/phpmyadmin/master
:alt: Infection MSI
:target: https://infection.github.io

149
build.xml
View File

@ -1,149 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="phpMyAdmin" default="build" basedir=".">
<property name="source" value="."/>
<property name="source_comma_sep" value="."/>
<property environment="env"/>
<property name="env.PHPUNIT_XML" value="phpunit.xml.dist"/>
<property name="env.PHPUNIT_ARGS" value="--testsuite unit"/>
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>
<target name="phpunit" description="Run unit tests using PHPUnit and generates junit.xml and clover.xml">
<exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
<arg line="--configuration ${env.PHPUNIT_XML} ${env.PHPUNIT_ARGS}"/>
</exec>
</target>
<target name="phpunit-nocoverage" description="Run unit tests using PHPUnit and generates junit.xml">
<exec executable="${basedir}/vendor/bin/phpunit" failonerror="true">
<arg line="--configuration --no-coverage ${env.PHPUNIT_ARGS}"/>
</exec>
</target>
<target name="pdepend" description="Generate jdepend.xml and software metrics charts using PHP_Depend">
<exec executable="pdepend">
<arg line="'--jdepend-xml=${basedir}/build/logs/jdepend.xml'
'--jdepend-chart=${basedir}/build/pdepend/dependencies.svg'
'--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg'
${source_comma_sep}" />
</exec>
</target>
<target name="phpmd" description="Generate pmd.xml using PHPMD">
<exec executable="phpmd">
<arg line="${source_comma_sep}
xml
codesize,design,naming,unusedcode
--exclude test,build,vendor,tmp
--reportfile '${basedir}/build/logs/pmd.xml'" />
</exec>
</target>
<target name="phpcpd" description="Generate pmd-cpd.xml using PHPCPD">
<exec executable="phpcpd">
<arg line="--log-pmd '${basedir}/build/logs/pmd-cpd.xml'
--exclude test
--exclude tmp
--exclude build
--exclude vendor
${source}" />
</exec>
</target>
<target name="phploc" description="Generate phploc.csv">
<exec executable="phploc">
<arg line="--log-csv '${basedir}/build/logs/phploc.csv'
--exclude test
--exclude build
--exclude vendor
--exclude tmp
${source}" />
</exec>
</target>
<target name="phpcs-config" description="PHPCS configuration tweaking">
<exec executable="${basedir}/vendor/bin/phpcs">
<arg line="--config-set installed_paths ${basedir}/vendor/doctrine/coding-standard/lib,${basedir}/vendor/phpmyadmin/coding-standard,${basedir}/vendor/slevomat/coding-standard" />
</exec>
</target>
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding third party libraries" depends="phpcs-config">
<exec executable="${basedir}/vendor/bin/phpcs">
<arg line="
--report=checkstyle
--report-file='${basedir}/build/logs/checkstyle.xml'
${source}" />
</exec>
</target>
<target name="phpstan" description="Run phpstan static code analysis">
<exec executable="${basedir}/vendor/bin/phpstan" failonerror="true">
<redirector error="/dev/stdout" output="${basedir}/build/logs/phpstan.xml"/>
<arg line="analyse --error-format=checkstyle"/>
</exec>
</target>
<target name="phpdoc" description="Generate API documentation using Doctum">
<!-- ant phpdoc -Denv.DOCTUM_BIN_PATH="/usr/bin/doctum" -->
<!-- please use 5.3.0 as a minimum version -->
<!-- Download the latest 5.x.x version -->
<!-- curl -o /bin/doctum https://doctum.long-term.support/releases/5/doctum.phar && chmod +x /bin/doctum -->
<property name="env.DOCTUM_BIN_PATH" value="/bin/doctum"/>
<exec executable="${env.DOCTUM_BIN_PATH}" failonerror="true">
<redirector error="${basedir}/build/logs/doctum.xml"/>
<arg line="--no-interaction update ./test/doctum-config.php -v --force --no-progress --no-ansi --output-format=checkstyle" />
</exec>
</target>
<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<arg line="--log '${basedir}/build/logs'
--source '${source}'
--output '${basedir}/build/code-browser'" />
</exec>
</target>
<target name="eslint" description="Javascript checks">
<apply executable="${basedir}/node_modules/.bin/eslint" output="${basedir}/build/logs/eslint.xml" parallel="true">
<arg line="--format=checkstyle js/src" />
<fileset dir="${basedir}">
<include name="js/src/**/*.js" />
</fileset>
</apply>
</target>
<target name="locales" description="Generate locales">
<exec executable="./scripts/generate-mo" failonerror="true">
<arg line="--quiet" />
</exec>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l" />
<fileset dir="${basedir}">
<include name="libraries/**/*.php" />
<include name="setup/**/*.php" />
<include name="test/**/*.php" />
<include name="*.php" />
<modified />
</fileset>
</apply>
</target>
<target name="build" depends="clean,phpunit,pdepend,phpmd,phpcpd,phpcs,phpdoc,phploc,phpcb,lint,eslint,locales"/>
</project>

View File

@ -5,6 +5,7 @@
"keywords": ["phpmyadmin","mysql","web"],
"homepage": "https://www.phpmyadmin.net/",
"support": {
"security": "https://www.phpmyadmin.net/security/",
"forum": "https://www.phpmyadmin.net/support/",
"issues": "https://github.com/phpmyadmin/phpmyadmin/issues",
"wiki": "https://wiki.phpmyadmin.net/",
@ -61,11 +62,11 @@
"paragonie/sodium_compat": "^1.17",
"phpmyadmin/motranslator": "^5.0",
"phpmyadmin/shapefile": "^3.0.1",
"phpmyadmin/sql-parser": "^5.6.0",
"phpmyadmin/twig-i18n-extension": "^4.0",
"phpmyadmin/sql-parser": "^5.8",
"phpmyadmin/twig-i18n-extension": "^4.1.3 || ^5.0.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0",
"slim/psr7": "^1.4",
"slim/psr7": "^1.4.1",
"symfony/config": "^5.2.3",
"symfony/dependency-injection": "^5.2.3",
"symfony/expression-language": "^5.2.3",
@ -101,19 +102,20 @@
"code-lts/u2f-php-server": "^1.2",
"php-webdriver/webdriver": "^1.13",
"phpmyadmin/coding-standard": "^3.0.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.4.8",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^8.5 || ^9.5",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.12",
"phpstan/phpstan-deprecation-rules": "^1.2",
"phpstan/phpstan-phpunit": "^1.4",
"phpstan/phpstan-strict-rules": "^1.6",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^8.5.16 || ^9.6",
"pragmarx/google2fa-qrcode": "^2.1",
"psalm/plugin-phpunit": "^0.16.1",
"roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "~3.6.0",
"symfony/console": "^5.2.3",
"tecnickcom/tcpdf": "^6.4.4",
"vimeo/psalm": "^4.22",
"web-auth/webauthn-lib": "^3.3"
"vimeo/psalm": "^4.30",
"web-auth/webauthn-lib": "^3.3.2"
},
"extra": {
"branch-alias": {

View File

@ -44,14 +44,14 @@ master_doc = 'index'
# General information about the project.
project = u'phpMyAdmin'
copyright = u'2012 - 2021, The phpMyAdmin devel team'
copyright = u'2012 - 2024, The phpMyAdmin devel team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '5.2.1'
version = '5.2.2'
# The full version, including alpha/beta/rc tags.
release = version
@ -100,6 +100,16 @@ pygments_style = 'sphinx'
# a list of builtin themes.
html_theme = 'default'
# See: https://docs.readthedocs.io/en/stable/reference/environment-variables.html#envvar-READTHEDOCS
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if on_rtd: # only import and set the theme if we're building docs on readthedocs
try:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
except:
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
@ -315,6 +325,4 @@ linkcheck_ignore = [
r'https://authy.com/.*',
# Site often changes links and reverts changes (9362bde02d0535a2f8cb74a18797249cb734c4b0)
r'https://www.yubico.com/.*',
# Some timeouts and SSL issues: https://github.com/sektioneins/suhosin/issues/119
r'https://suhosin.org/.*',
]

View File

@ -685,6 +685,11 @@ Server connection settings
login is still tried first, but as fallback, no password method is
tried.
.. note::
It is possible to allow logging in with no password with
the :config:option:`$cfg['Servers'][$i]['AllowNoPassword']` directive.
.. _servers_only_db:
.. config:option:: $cfg['Servers'][$i]['only_db']
@ -1588,7 +1593,7 @@ Generic settings
:type: boolean
:default: false
You can disable phpMyAdmin shortcut keys by setting :config:option:`$cfg['DisableShortcutKeys']` to false.
You can disable phpMyAdmin shortcut keys by setting :config:option:`$cfg['DisableShortcutKeys']` to true.
.. config:option:: $cfg['ServerDefault']
@ -1804,6 +1809,15 @@ Generic settings
middle-clicking for pasting the clipboard contents in some Linux
distributions (such as Ubuntu) is not supported by all browsers.
.. config:option:: $cfg['LintEnable']
:type: boolean
:default: true
.. versionadded:: 4.5.0
Defines whether to use the parser to find any errors in the query before executing.
.. config:option:: $cfg['DefaultForeignKeyChecks']
:type: string
@ -1890,6 +1904,13 @@ Generic settings
.. seealso:: :ref:`faq2_10`
.. config:option:: $cfg['maxRowPlotLimit']
:type: integer
:default: 500
Maximum number of rows retrieved for zoom search.
Cookie authentication options
-----------------------------
@ -1961,7 +1982,7 @@ Cookie authentication options
* ``Strict``
* ``None``
.. seealso:: `rfc6265 bis <https://tools.ietf.org/id/draft-ietf-httpbis-rfc6265bis-03.html#rfc.section.5.3.7>`_
.. seealso:: `rfc6265 bis <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-03#section-5.3.7>`_
.. config:option:: $cfg['LoginCookieRecall']
@ -2385,6 +2406,13 @@ Navigation panel setup
Whether to show events under database in the navigation panel.
.. config:option:: $cfg['NavigationTreeAutoexpandSingleDb']
:type: boolean
:default: true
Whether to expand single database in the navigation tree automatically.
.. config:option:: $cfg['NavigationWidth']
:type: integer
@ -2480,6 +2508,20 @@ Main panel
Database structure
------------------
.. config:option:: $cfg['ShowDbStructureCharset']
:type: boolean
:default: false
Defines whether to show a column displaying the charset for all tables in the database structure page.
.. config:option:: $cfg['ShowDbStructureComment']
:type: boolean
:default: false
Defines whether to show a column displaying the comments for all tables in the database structure page.
.. config:option:: $cfg['ShowDbStructureCreation']
:type: boolean
@ -2579,6 +2621,19 @@ Browse mode
.. versionchanged:: 3.4.0
Since phpMyAdmin 3.4.0 the default value is ``'SMART'``.
.. config:option:: $cfg['DisplayBinaryAsHex']
:type: boolean
:default: true
Defines whether the ":guilabel:`Show binary contents as HEX`" browse option is
ticked by default.
.. versionadded:: 3.3.0
.. deprecated:: 4.3.0
This setting was removed.
.. config:option:: $cfg['GridEditing']
:type: string
@ -2726,6 +2781,13 @@ Export and import settings
* ``custom-no-form`` same as ``custom`` but does not display the option
of using quick export
.. config:option:: $cfg['Export']['compression']
:type: string
:default: ``'none'``
Default export compression method. Possible values are ``'none'``, ``'zip'`` or ``'gzip'``.
.. config:option:: $cfg['Export']['charset']
:type: string
@ -2787,6 +2849,18 @@ Export and import settings
Defines charset for import. By default no charset conversion is done
assuming UTF-8.
.. config:option:: $cfg['Schema']
:type: array
:default: array(...)
.. config:option:: $cfg['Schema']['format']
:type: string
:default: ``'pdf'``
Defines the default format for schema export. Possible values are ``'pdf'``, ``'eps'``, ``'dia'`` or ``'svg'``.
Tabs display settings
---------------------
@ -3391,11 +3465,49 @@ Various display setting
Repeat the headers every X cells, or 0 to deactivate.
.. config:option:: $cfg['EditInWindow']
:type: boolean
:default: true
.. seealso:: `Feature request to add a pop-up window back <https://github.com/phpmyadmin/phpmyadmin/issues/11983>`_
.. deprecated:: 4.3.0
This setting was removed.
.. config:option:: $cfg['QueryWindowWidth']
:type: integer
:default: 550
.. deprecated:: 4.3.0
This setting was removed.
.. config:option:: $cfg['QueryWindowHeight']
:type: integer
:default: 310
.. deprecated:: 4.3.0
This setting was removed.
.. config:option:: $cfg['QueryHistoryDB']
:type: boolean
:default: false
.. config:option:: $cfg['QueryWindowDefTab']
:type: string
:default: ``'sql'``
.. deprecated:: 4.3.0
This setting was removed.
.. config:option:: $cfg['QueryHistoryMax']
:type: integer
@ -3501,6 +3613,10 @@ Various display setting
Page titles
-----------
The page title displayed by your browser's window or tab title bar can be customized. You can use :ref:`faq6_27`.
The following four options allow customizing various parts of the phpMyAdmin interface. Note that the login page
title cannot be changed.
.. config:option:: $cfg['TitleTable']
:type: string
@ -3521,8 +3637,6 @@ Page titles
:type: string
:default: ``'@HTTP_HOST@ | @PHPMYADMIN@'``
Allows you to specify window's title bar. You can use :ref:`faq6_27`.
Theme manager settings
----------------------
@ -3962,3 +4076,33 @@ reCaptcha using hCaptcha
.. seealso:: `hCaptcha website <https://www.hcaptcha.com/>`_
.. seealso:: `hCaptcha Developer Guide <https://docs.hcaptcha.com/>`_
reCaptcha using Turnstile
+++++++++++++++++++++++++
.. code-block:: php
$cfg['CaptchaMethod'] = 'checkbox';
$cfg['CaptchaApi'] = 'https://challenges.cloudflare.com/turnstile/v0/api.js';
$cfg['CaptchaCsp'] = 'https://challenges.cloudflare.com https://static.cloudflareinsights.com';
$cfg['CaptchaRequestParam'] = 'cf-turnstile';
$cfg['CaptchaResponseParam'] = 'cf-turnstile-response';
$cfg['CaptchaLoginPublicKey'] = '0xxxxxxxxxxxxxxxxxxxxxx';
$cfg['CaptchaLoginPrivateKey'] = '0x4AAAAAAAA_xx_xxxxxxxxxxxxxxxxxxxx';
$cfg['CaptchaSiteVerifyURL'] = 'https://challenges.cloudflare.com/turnstile/v0/siteverify';
.. seealso:: `Cloudflare Dashboard <https://dash.cloudflare.com/>`_
.. seealso:: `Turnstile Developer Guide <https://developers.cloudflare.com/turnstile/get-started/>`_
reCaptcha using Google reCaptcha v2/v3
++++++++++++++++++++++++++++++++++++++
.. code-block:: php
$cfg['CaptchaLoginPublicKey'] = 'xxxxxxxxxxxxxxxx-xxxxxxxxxxxx';
$cfg['CaptchaLoginPrivateKey'] = 'xxxxxxxxx-xxxxxxxxxxxxxx';
// Remove it if you dot not want the checkbox mode
$cfg['CaptchaMethod'] = 'checkbox';
.. seealso:: `Google reCaptcha Developer's Guide <https://developers.google.com/recaptcha/intro>`_
.. seealso:: `Google reCaptcha types <https://developers.google.com/recaptcha/docs/versions>`_

View File

@ -552,41 +552,41 @@ The default values for most Suhosin configuration options will work in
most scenarios, however you might want to adjust at least following
parameters:
* `suhosin.request.max\_vars <https://suhosin.org/stories/configuration.html#suhosin-request-max-vars>`_ should
* `suhosin.request.max\_vars <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-request-max-vars>`_ should
be increased (eg. 2048)
* `suhosin.post.max\_vars <https://suhosin.org/stories/configuration.html#suhosin-post-max-vars>`_ should be
* `suhosin.post.max\_vars <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-post-max-vars>`_ should be
increased (eg. 2048)
* `suhosin.request.max\_array\_index\_length <https://suhosin.org/stories/configuration.html#suhosin-request-max-array-index-length>`_
* `suhosin.request.max\_array\_index\_length <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-request-max-array-index-length>`_
should be increased (eg. 256)
* `suhosin.post.max\_array\_index\_length <https://suhosin.org/stories/configuration.html#suhosin-post-max-array-index-length>`_
* `suhosin.post.max\_array\_index\_length <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-post-max-array-index-length>`_
should be increased (eg. 256)
* `suhosin.request.max\_totalname\_length <https://suhosin.org/stories/configuration.html#suhosin-request-max-totalname-length>`_
* `suhosin.request.max\_totalname\_length <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-request-max-totalname-length>`_
should be increased (eg. 8192)
* `suhosin.post.max\_totalname\_length <https://suhosin.org/stories/configuration.html#suhosin-post-max-totalname-length>`_ should be
* `suhosin.post.max\_totalname\_length <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-post-max-totalname-length>`_ should be
increased (eg. 8192)
* `suhosin.get.max\_value\_length <https://suhosin.org/stories/configuration.html#suhosin-get-max-value-length>`_
* `suhosin.get.max\_value\_length <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-get-max-value-length>`_
should be increased (eg. 1024)
* `suhosin.sql.bailout\_on\_error <https://suhosin.org/stories/configuration.html#suhosin-sql-bailout-on-error>`_
* `suhosin.sql.bailout\_on\_error <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-sql-bailout-on-error>`_
needs to be disabled (the default)
* `suhosin.log.\* <https://suhosin.org/stories/configuration.html#logging-configuration>`_ should not
* `suhosin.log.\* <https://suhosin5.suhosin.org/stories/configuration.html#logging-configuration>`_ should not
include :term:`SQL`, otherwise you get big
slowdown
* `suhosin.sql.union <https://suhosin.org/stories/configuration.html#suhosin-
* `suhosin.sql.union <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-
sql-union>`_ must be disabled (which is the default).
* `suhosin.sql.multiselect <https://suhosin.org/stories/configuration.html#
* `suhosin.sql.multiselect <https://suhosin5.suhosin.org/stories/configuration.html#
suhosin-sql-multiselect>`_ must be disabled (which is the default).
* `suhosin.sql.comment <https://suhosin.org/stories/configuration.html#suhosin-
* `suhosin.sql.comment <https://suhosin5.suhosin.org/stories/configuration.html#suhosin-
sql-comment>`_ must be disabled (which is the default).
To further improve security, we also recommend these modifications:
* `suhosin.executor.include.max\_traversal <https://suhosin.org/stories/
* `suhosin.executor.include.max\_traversal <https://suhosin5.suhosin.org/stories/
configuration.html#suhosin-executor-include-max-traversal>`_ should be
enabled as a mitigation against local file inclusion attacks. We suggest
setting this to 2 as ``../`` is used with the ReCaptcha library.
* `suhosin.cookie.encrypt <https://suhosin.org/stories/configuration.html#
* `suhosin.cookie.encrypt <https://suhosin5.suhosin.org/stories/configuration.html#
suhosin-cookie-encrypt>`_ should be enabled.
* `suhosin.executor.disable_emodifier <https://suhosin.org/stories/config
* `suhosin.executor.disable_emodifier <https://suhosin5.suhosin.org/stories/config
uration.html#suhosin-executor-disable-emodifier>`_ should be enabled.
You can also disable the warning using the :config:option:`$cfg['SuhosinDisableWarning']`.
@ -850,8 +850,8 @@ Here are a few points to check:
Dorninger for the hint).
* In the :file:`php.ini` directive ``arg_separator.input``, a value of ";"
will cause this error. Replace it with "&;".
* If you are using `Suhosin <https://suhosin.org/stories/index.html>`_, you
might want to increase `request limits <https://suhosin.org/stories/faq.html>`_.
* If you are using `Suhosin <https://suhosin5.suhosin.org/stories/index.html>`_, you
might want to increase `request limits <https://suhosin5.suhosin.org/stories/faq.html>`_.
* The directory specified in the :file:`php.ini` directive
``session.save_path`` does not exist or is read-only (this can be caused
by `bug in the PHP installer <https://bugs.php.net/bug.php?id=39842>`_).

View File

@ -50,7 +50,8 @@ Shortcut keys
Currently phpMyAdmin supports following shortcuts:
* k - Toggle console
* k and CTRL+k - Toggle console
* CTRL+ALT+c - Toggle console
* h - Go to home page
* s - Open settings
* d + s - Go to database structure (Provided you are in database related page)

View File

@ -67,7 +67,7 @@ Red Hat Enterprise Linux
Red Hat Enterprise Linux itself and thus derivatives like CentOS don't
ship phpMyAdmin, but the Fedora-driven repository
`Extra Packages for Enterprise Linux (EPEL) <https://fedoraproject.org/wiki/EPEL>`_
`Extra Packages for Enterprise Linux (EPEL) <https://docs.fedoraproject.org/en-US/epel/>`_
is doing so, if it's
`enabled <https://fedoraproject.org/wiki/EPEL/FAQ#howtouse>`_.
But be aware that the configuration file is maintained in
@ -90,7 +90,7 @@ In order to install from Git, you'll need a few supporting applications:
* `Git <https://git-scm.com/downloads>`_ to download the source, or you can download the most recent source directly from `Github <https://codeload.github.com/phpmyadmin/phpmyadmin/zip/QA_5_2>`_
* `Composer <https://getcomposer.org/download/>`__
* `Node.js <https://nodejs.org/en/download/>`_ (version 10 or higher)
* `Node.js <https://nodejs.org/en/download/>`_ (version 12 or higher)
* `Yarn <https://classic.yarnpkg.com/en/docs/install>`_
You can clone current phpMyAdmin source from
@ -222,6 +222,16 @@ You can configure several phpMyAdmin features using environment variables:
.. note:: Used only if :envvar:`PMA_PORT` is empty.
.. envvar:: PMA_SOCKET
Socket file for the database connection.
.. envvar:: PMA_SOCKETS
Comma-separated list of socket files for the database connections.
.. note:: Used only if :envvar:`PMA_SOCKET` is empty.
.. envvar:: PMA_ABSOLUTE_URI
The fully-qualified path (``https://pma.example.net/``) where the reverse
@ -319,6 +329,98 @@ You can configure several phpMyAdmin features using environment variables:
If set, this option will change the default Apache port from `80` in case you want it to run on a different port like an unprivileged port. Set to any port value (such as `APACHE_PORT=8090`).
.. envvar:: PMA_SSL_DIR
Define the path used for SSL files generated from environment variables, default value is `/etc/phpmyadmin/ssl`.
.. envvar:: PMA_SSL
When set to `1`, defines SSL usage for the MySQL connection.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl']`
.. envvar:: PMA_SSLS
Comma-separated list of `0` and `1` defining SSL usage for the corresponding MySQL connections.
.. envvar:: PMA_SSL_VERIFY
When set to `1`, enables SSL certificate verification for the MySQL connection.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_verify']`
.. envvar:: PMA_SSL_VERIFIES
Comma-separated list of `0` and `1` to enable or disable SSL certificate verification for multiple MySQL connections.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_verify']`
.. envvar:: PMA_SSL_CA
In the context of mutual TLS security, allows setting your CA file as a string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_ca']`
.. envvar:: PMA_SSL_CAS
In the context of mutual TLS security, allows setting multiple CA files as a comma-separated list of strings inside the default `config.inc.php`.
.. envvar:: PMA_SSL_CA_BASE64
In the context of mutual TLS security, allows setting your CA file as a base64 string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_ca']`
.. envvar:: PMA_SSL_CAS_BASE64
In the context of mutual TLS security, allows setting multiple CA files as a comma-separated list of base64 strings inside the default `config.inc.php`.
.. envvar:: PMA_SSL_CERT
In the context of mutual TLS security, allows setting your CERT file as a string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_cert']`
.. envvar:: PMA_SSL_CERTS
In the context of mutual TLS security, allows setting multiple CERT files as a comma-separated list of strings inside the default `config.inc.php`.
.. envvar:: PMA_SSL_CERT_BASE64
In the context of mutual TLS security, allows setting your CERT file as a base64 string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_cert']`
.. envvar:: PMA_SSL_CERTS_BASE64
In the context of mutual TLS security, allows setting multiple CERT files as a comma-separated list of base64 strings inside the default `config.inc.php`.
.. envvar:: PMA_SSL_KEY
In the context of mutual TLS security, allows setting your KEY file as a string inside the default `config.inc.php`.
.. envvar:: PMA_SSL_KEYS
In the context of mutual TLS security, allows setting multiple KEY files as a comma-separated list of strings inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_key']`
.. envvar:: PMA_SSL_KEY_BASE64
In the context of mutual TLS security, allows setting your KEY file as a base64 string inside the default `config.inc.php`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['ssl_key']`
.. envvar:: PMA_SSL_KEYS_BASE64
In the context of mutual TLS security, allows setting multiple KEY files as a comma-separated list of base64 strings inside the default `config.inc.php`.
.. envvar:: TZ
If defined, this option will change the default PHP `date.timezone` from `UTC`.
.. seealso:: :config:option:`$cfg['Servers'][$i]['SessionTimeZone']`
By default, :ref:`cookie` is used, but if :envvar:`PMA_USER` and
:envvar:`PMA_PASSWORD` are set, it is switched to :ref:`auth_config`.
@ -446,7 +548,7 @@ arbitrary server - allowing you to specify MySQL/MariaDB server on the login pag
.. code-block:: sh
docker-compose up -d
docker compose up -d
Customizing configuration file using docker-compose
---------------------------------------------------
@ -563,7 +665,7 @@ Quick Install
#. Choose an appropriate distribution kit from the phpmyadmin.net
Downloads page. Some kits contain only the English messages, others
contain all languages. We'll assume you chose a kit whose name
looks like ``phpMyAdmin-x.x.x -all-languages.tar.gz``.
looks like ``phpMyAdmin-x.x.x-all-languages.tar.gz``.
#. Ensure you have downloaded a genuine archive, see :ref:`verify`.
#. Untar or unzip the distribution (be sure to unzip the subdirectories):
``tar -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz`` in your

View File

@ -53,8 +53,8 @@ There are several manufacturers of these tokens, for example:
* `youbico FIDO U2F Security Key <https://www.yubico.com/fido-u2f/>`_
* `HyperFIDO <https://www.hypersecu.com/hyperfido>`_
* `Trezor Hardware Wallet <https://trezor.io/?offer_id=12&aff_id=1592&source=phpmyadmin>`_ can act as an `U2F token <https://wiki.trezor.io/User_manual:Two-factor_Authentication_with_U2F>`_
* `List of Two Factor Auth (2FA) Dongles <https://www.dongleauth.info/dongles/>`_
* `Trezor Hardware Wallet <https://trezor.io/?offer_id=12&aff_id=1592&source=phpmyadmin>`_ can act as an `U2F token <https://trezor.io/learn/a/what-is-u2f>`_
* `List of Two Factor Auth (2FA) Dongles <https://www.dongleauth.com/dongles/>`_
.. _simple2fa:

View File

@ -36,8 +36,8 @@ Specific files LICENSES
phpMyAdmin distributed themes contain some content that is under licenses.
- The icons of the `Original` and `pmahomme` themes are from the `Silk Icons <http://www.famfamfam.com/lab/icons/silk/>`_.
- Some icons of the `Metro` theme are from the `Silk Icons <http://www.famfamfam.com/lab/icons/silk/>`_.
- The icons of the `Original` and `pmahomme` themes are from the `Silk Icons <https://web.archive.org/web/20221201060206/http://www.famfamfam.com/lab/icons/silk/>`_.
- Some icons of the `Metro` theme are from the `Silk Icons <https://web.archive.org/web/20221201060206/http://www.famfamfam.com/lab/icons/silk/>`_.
- `themes/*/img/b_rename.svg` Is a `Icons8 <https://thenounproject.com/Icons8/>`_, icon from the `Android L Icon Pack Collection <https://thenounproject.com/Icons8/collection/android-l-icon-pack/>`_. The icon `rename <https://thenounproject.com/term/rename/61456/>`_.
- `themes/metro/img/user.svg` Is a IcoMoon the `user <https://github.com/Keyamoon/IcoMoon-Free/blob/master/SVG/114-user.svg>`_
@ -46,6 +46,6 @@ CC BY 4.0 or GPL
Licenses for vendors
--------------------
- Silk Icons are under the `CC BY 2.5 or CC BY 3.0 <http://www.famfamfam.com/lab/icons/silk/>`_ licenses.
- Silk Icons are under the `CC BY 2.5 or CC BY 3.0 <https://web.archive.org/web/20221201060206/http://www.famfamfam.com/lab/icons/silk/>`_ licenses.
- `rename` from `Icons8` is under the `"public domain" <https://creativecommons.org/publicdomain/zero/1.0/>`_ (CC0 1.0) license.
- IcoMoon Free is under `"CC BY 4.0 or GPL" <https://github.com/Keyamoon/IcoMoon-Free/blob/master/License.txt>`_.

View File

@ -16,4 +16,7 @@ module.exports = {
libraryTarget: 'umd',
libraryExport: 'default',
},
optimization: {
minimize: false,
},
};

View File

@ -894,11 +894,16 @@ $(document).on('submit', 'form', AJAX.requestHandler);
* Gracefully handle fatal server errors
* (e.g: 500 - Internal server error)
*/
$(document).on('ajaxError', function (event, request) {
$(document).on('ajaxError', function (event, request, settings) {
if (AJAX.debug) {
// eslint-disable-next-line no-console
console.log('AJAX error: status=' + request.status + ', text=' + request.statusText);
}
if (settings.url.includes('/git-revision')) {
return;
}
// Don't handle aborted requests
if (request.status !== 0 || request.statusText !== 'abort') {
var details = '';

View File

@ -287,7 +287,7 @@ JQPlotLineChart.prototype.populateOptions = function (dataTable, options) {
if (optional.axes.xaxis.ticks.length === 0) {
var data = dataTable.getData();
for (var j = 0; j < data.length; j++) {
optional.axes.xaxis.ticks.push(data[j][0].toString());
optional.axes.xaxis.ticks.push(data[j][0] !== null ? data[j][0].toString() : null);
}
}
return optional;

View File

@ -34,6 +34,7 @@ CodeMirror.sqlLint = function (text, updateLinting, options, cm) {
'server': CommonParams.get('server'),
'options': options.lintOptions,
'no_history': true,
'ajax_request': true,
},
success: handleResponse
});

View File

@ -487,7 +487,7 @@ var ConsoleResizer = {
* @return {void}
*/
mouseUp: function () {
Console.setConfig('Height', ConsoleResizer.resultHeight);
Console.setConfig('Height', Math.round(ConsoleResizer.resultHeight));
Console.show();
$(document).off('mousemove');
$(document).off('mouseup');
@ -1466,8 +1466,9 @@ var ConsoleDebug = {
)
);
if (url) {
var decodedUrl = new URLSearchParams(url.split('?')[1]);
$('#debug_console').find('.debug>.welcome').append(
$('<span class="script_name">').text(url.split('?')[0])
$('<span class="script_name">').text(decodedUrl.has('route') ? decodedUrl.get('route') : url)
);
}

View File

@ -295,7 +295,7 @@ const DatabaseEvents = {
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
width: 700,
width: '70%',
minWidth: 500,
buttons: buttonOptions,
// Issue #15810 - use button titles for modals (eg: new procedure)
@ -334,8 +334,7 @@ const DatabaseEvents = {
* the Definition textarea.
*/
var $elm = $('textarea[name=item_definition]').last();
var linterOptions = {};
linterOptions.eventEditor = true;
var linterOptions = { editorType: 'event' };
that.syntaxHiglighter = Functions.getSqlEditor($elm, {}, 'both', linterOptions);
} else {
Functions.ajaxShowMessage(data.error, false);

View File

@ -22,18 +22,31 @@ AJAX.registerTeardown('database/multi_table_query.js', function () {
$('.tableNameSelect').each(function () {
$(this).off('change');
});
$('.columnNameSelect').each(function () {
$(this).off('change');
});
$('.criteria_op').each(function () {
$(this).off('change');
});
$('#update_query_button').off('click');
$('#add_column_button').off('click');
});
AJAX.registerOnload('database/multi_table_query.js', function () {
var editor = Functions.getSqlEditor($('#MultiSqlquery'), {}, 'both');
var editor = Functions.getSqlEditor($('#MultiSqlquery'), {}, 'vertical');
$('.CodeMirror-line').css('text-align', 'left');
editor.setSize(-1, 50);
editor.setSize(-1, -1);
var columnCount = 3;
addNewColumnCallbacks();
function theHints () {
return {
'IN (...)': 'Separate the values by commas',
'NOT IN (...)': 'Separate the values by commas',
};
}
$('#update_query_button').on('click', function () {
var columns = [];
var tableAliases = {};
@ -162,14 +175,47 @@ AJAX.registerOnload('database/multi_table_query.js', function () {
addNewColumnCallbacks();
});
$('.columnNameSelect').each(function () {
$(this).on('change', function () {
const colIsStar = $(this).val() === '*';
colIsStar && $(this).siblings('.col_alias').val('');
$(this).siblings('.col_alias').prop('disabled', colIsStar);
});
});
$('.criteria_op').each(function () {
$(this).on('change', function () {
showHint($(this));
});
});
function showHint (opSelect) {
const hints = theHints();
const value = opSelect.val();
const criteriaInputCol = opSelect.closest('table').find('.rhs_text_val').parent();
criteriaInputCol.find('.rhs_hint').remove();
Object.keys(hints).includes(value) && criteriaInputCol.append(`<p class="rhs_hint">${hints[value]}</p>`);
}
function addNewColumnCallbacks () {
$('.tableNameSelect').each(function () {
$(this).on('change', function () {
var $sibs = $(this).siblings('.columnNameSelect');
if ($sibs.length === 0) {
$sibs = $(this).parent().parent().find('.columnNameSelect');
}
$sibs.first().html($('#' + $(this).find(':selected').data('hash')).html());
const $table = $(this);
const $alias = $table.siblings('.col_alias');
const $colsSelect = $table.parent().find('.columnNameSelect');
$alias.prop('disabled', true);
$colsSelect.each(function () {
$(this).show();
$(this).first().html($('#' + $table.find(':selected').data('hash')).html());
if ($(this).hasClass('opColumn')) {
$(this).find('option[value="*"]').remove();
}
});
});
});
@ -195,7 +241,10 @@ AJAX.registerOnload('database/multi_table_query.js', function () {
$('.criteria_col').each(function () {
$(this).on('change', function () {
var $anchor = $(this).siblings('.jsCriteriaButton').first();
if ($(this).is(':checked') && ! $anchor.hasClass('collapsed')) {
if (
($(this).is(':checked') && ! $anchor.hasClass('collapsed'))
|| (! $(this).is(':checked') && $anchor.hasClass('collapsed'))
) {
// Do not collapse on checkbox tick as it does not make sense
// The user has it open and wants to tick the box
return;

View File

@ -10,6 +10,13 @@
/* global sprintf */ // js/vendor/sprintf.js
$(document).on('change', '.criteria_op', function () {
const op = $(this).val();
const criteria = $(this).closest('.table').find('.rhs_text_val');
isOpWithoutArg(op) ? criteria.hide().val('') : criteria.show();
});
function getFormatsText () {
return {
'=': ' = \'%s\'',
@ -22,26 +29,48 @@ function getFormatsText () {
'LIKE %...%': ' LIKE \'%%%s%%\'',
'NOT LIKE': ' NOT LIKE \'%s\'',
'NOT LIKE %...%': ' NOT LIKE \'%%%s%%\'',
'IN (...)': ' IN (%s)',
'NOT IN (...)': ' NOT IN (%s)',
'BETWEEN': ' BETWEEN \'%s\'',
'NOT BETWEEN': ' NOT BETWEEN \'%s\'',
'IS NULL': ' \'%s\' IS NULL',
'IS NOT NULL': ' \'%s\' IS NOT NULL',
'REGEXP': ' REGEXP \'%s\'',
'REGEXP ^...$': ' REGEXP \'^%s$\'',
'NOT REGEXP': ' NOT REGEXP \'%s\''
};
}
function opsWithoutArg () {
return ['IS NULL', 'IS NOT NULL'];
}
function isOpWithoutArg (op) {
return opsWithoutArg().includes(op);
}
function generateCondition (criteriaDiv, table) {
var query = '`' + Functions.escapeBacktick(table.val()) + '`.';
query += '`' + Functions.escapeBacktick(table.siblings('.columnNameSelect').first().val()) + '`';
const tableName = table.val();
const tableAlias = table.siblings('.table_alias').val();
const criteriaOp = criteriaDiv.find('.criteria_op').first().val();
let criteriaText = criteriaDiv.find('.rhs_text_val').first().val();
let query = '`' + Functions.escapeBacktick(tableAlias === '' ? tableName : tableAlias) + '`.';
query += '`' + Functions.escapeBacktick(table.parent().find('.opColumn').first().val()) + '`';
if (criteriaDiv.find('.criteria_rhs').first().val() === 'text') {
var formatsText = getFormatsText();
query += sprintf(formatsText[criteriaDiv.find('.criteria_op').first().val()], Functions.escapeSingleQuote(criteriaDiv.find('.rhs_text_val').first().val()));
if (isOpWithoutArg(criteriaOp)) {
query += ' ' + criteriaOp;
} else {
const formatsText = getFormatsText();
if (!['IN (...)', 'NOT IN (...)'].includes(criteriaOp)) {
criteriaText = Functions.escapeSingleQuote(criteriaText);
}
query += sprintf(formatsText[criteriaOp], criteriaText);
}
} else {
query += ' ' + criteriaDiv.find('.criteria_op').first().val();
query += ' ' + criteriaOp;
query += ' `' + Functions.escapeBacktick(criteriaDiv.find('.tableNameSelect').first().val()) + '`.';
query += '`' + Functions.escapeBacktick(criteriaDiv.find('.columnNameSelect').first().val()) + '`';
query += '`' + Functions.escapeBacktick(criteriaDiv.find('.opColumn').first().val()) + '`';
}
return query;
}

View File

@ -308,8 +308,7 @@ const DatabaseRoutines = {
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
height: 400,
width: 700,
width: '70%',
minWidth: 500,
buttons: buttonOptions,
// Issue #15810 - use button titles for modals (eg: new procedure)
@ -348,8 +347,7 @@ const DatabaseRoutines = {
* the Definition textarea.
*/
var $elm = $('textarea[name=item_definition]').last();
var linterOptions = {};
linterOptions.routineEditor = true;
var linterOptions = { editorType: 'routine' };
that.syntaxHiglighter = Functions.getSqlEditor($elm, {}, 'both', linterOptions);
// Execute item-specific code

View File

@ -158,10 +158,10 @@ DatabaseStructure.fetchRealRowCount = function ($target) {
if (response.success) {
// If to update all row counts for a DB.
if (response.real_row_count_all) {
$.each(JSON.parse(response.real_row_count_all),
$.each(response.real_row_count_all,
function (index, table) {
// Update each table row count.
$('table.data td[data-table*="' + table.table + '"]')
$('table.data td[data-table*="' + Functions.escapeJsString(table.table) + '"]')
.text(table.row_count);
}
);

View File

@ -300,7 +300,7 @@ const DatabaseTriggers = {
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
width: 700,
width: '70%',
minWidth: 500,
buttons: buttonOptions,
// Issue #15810 - use button titles for modals (eg: new procedure)
@ -339,8 +339,7 @@ const DatabaseTriggers = {
* the Definition textarea.
*/
var $elm = $('textarea[name=item_definition]').last();
var linterOptions = {};
linterOptions.triggerEditor = true;
var linterOptions = { editorType: 'trigger' };
that.syntaxHiglighter = Functions.getSqlEditor($elm, {}, 'both', linterOptions);
} else {
Functions.ajaxShowMessage(data.error, false);

View File

@ -1960,16 +1960,16 @@ DesignerMove.addObject = function (dbName, tableName, colName, dbTableNameUrl) {
};
DesignerMove.enablePageContentEvents = function () {
$('#page_content').off('mousedown');
$('#page_content').off('mouseup');
$('#page_content').off('mousemove');
$('#page_content').on('mousedown', function (e) {
$(document).off('mousedown');
$(document).off('mouseup');
$(document).off('mousemove');
$(document).on('mousedown', function (e) {
DesignerMove.mouseDown(e);
});
$('#page_content').on('mouseup', function (e) {
$(document).on('mouseup', function (e) {
DesignerMove.mouseUp(e);
});
$('#page_content').on('mousemove', function (e) {
$(document).on('mousemove', function (e) {
DesignerMove.mouseMove(e);
});
};
@ -2068,9 +2068,9 @@ AJAX.registerTeardown('designer/move.js', function () {
$('#cancel_close_option').off('click');
$('#ok_new_rel_panel').off('click');
$('#cancel_new_rel_panel').off('click');
$('#page_content').off('mouseup');
$('#page_content').off('mousedown');
$('#page_content').off('mousemove');
$(document).off('mouseup');
$(document).off('mousedown');
$(document).off('mousemove');
});
AJAX.registerOnload('designer/move.js', function () {

View File

@ -727,16 +727,22 @@ Export.checkTimeOut = function (timeLimit) {
limit = limit + 1;
clearTimeout(timeOut);
timeOut = setTimeout(function () {
$.get('index.php?route=/export/check-time-out', { 'ajax_request': true }, function (data) {
if (data.message === 'timeout') {
Functions.ajaxShowMessage(
'<div class="alert alert-danger" role="alert">' +
Messages.strTimeOutError +
'</div>',
false
);
$.get('index.php?route=/export/check-time-out',
{
'ajax_request': true,
'server': CommonParams.get('server')
},
function (data) {
if (data.message === 'timeout') {
Functions.ajaxShowMessage(
'<div class="alert alert-danger" role="alert">' +
Messages.strTimeOutError +
'</div>',
false
);
}
}
});
);
}, limit * 1000);
};

View File

@ -430,7 +430,7 @@ Functions.escapeJsString = function (unsafe) {
* @return {string}
*/
Functions.escapeBacktick = function (s) {
return s.replace('`', '``');
return s.replaceAll('`', '``');
};
/**
@ -438,7 +438,7 @@ Functions.escapeBacktick = function (s) {
* @return {string}
*/
Functions.escapeSingleQuote = function (s) {
return s.replace('\\', '\\\\').replace('\'', '\\\'');
return s.replaceAll('\\', '\\\\').replaceAll('\'', '\\\'');
};
Functions.sprintf = function () {
@ -516,7 +516,7 @@ Functions.checkPasswordStrength = function (value, meterObject, meterObjectLabel
'my',
'admin',
];
if (username !== null) {
if (username) {
customDict.push(username);
}
@ -584,7 +584,11 @@ Functions.suggestPassword = function (passwordForm) {
passwordForm.elements.pma_pw2.value = passwd.value;
var meterObj = $jQueryPasswordForm.find('meter[name="pw_meter"]').first();
var meterObjLabel = $jQueryPasswordForm.find('span[name="pw_strength"]').first();
Functions.checkPasswordStrength(passwd.value, meterObj, meterObjLabel);
var username = '';
if (passwordForm.elements.username) {
username = passwordForm.elements.username.value;
}
Functions.checkPasswordStrength(passwd.value, meterObj, meterObjLabel, username);
return true;
};
@ -1131,15 +1135,10 @@ Functions.setQuery = function (query) {
* @return {void}
*/
Functions.handleSimulateQueryButton = function () {
var updateRegExp = new RegExp('^\\s*UPDATE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+SET\\s', 'i');
var deleteRegExp = new RegExp('^\\s*DELETE\\s+FROM\\s', 'i');
var query = '';
var updateRegExp = /^\s*UPDATE\b\s*(((`([^`]|``)+`)|([a-z0-9_$]+))\s*\.\s*)?((`([^`]|``)+`)|([a-z0-9_$]+))\s*\bSET\b/i;
var deleteRegExp = /^\s*DELETE\b\s*((((`([^`]|``)+`)|([a-z0-9_$]+))\s*\.\s*)?((`([^`]|``)+`)|([a-z0-9_$]+))\s*)?\bFROM\b/i;
if (codeMirrorEditor) {
query = codeMirrorEditor.getValue();
} else {
query = $('#sqlquery').val();
}
var query = codeMirrorEditor ? codeMirrorEditor.getValue() : $('#sqlquery').val();
var $simulateDml = $('#simulate_dml');
if (updateRegExp.test(query) || deleteRegExp.test(query)) {
@ -1215,7 +1214,7 @@ Functions.insertQuery = function (queryType) {
var query = '';
var myListBox = document.sqlform.dummy;
table = document.sqlform.table.value;
table = Functions.escapeBacktick(document.sqlform.table.value);
if (myListBox.options.length > 0) {
sqlBoxLocked = true;
@ -2082,6 +2081,7 @@ $(function () {
$(document).on('click', 'a.copyQueryBtn', function (event) {
event.preventDefault();
var res = Functions.copyToClipboard($(this).attr('data-text'));
if (res) {
$(this).after('<span id=\'copyStatus\'> (' + Messages.strCopyQueryButtonSuccess + ')</span>');
@ -2092,6 +2092,24 @@ $(function () {
$('#copyStatus').remove();
}, 2000);
});
$(document).on('mouseover mouseleave', '.ajax_notification a', function (event) {
let message = Messages.strDismiss;
if (event.type === 'mouseover') {
message = $(this).hasClass('copyQueryBtn') ? Messages.strCopyToClipboard : Messages.strEditQuery;
}
Functions.tooltip(
$('.ajax_notification'),
'span',
message
);
});
$(document).on('mouseup', '.ajax_notification a', function (event) {
event.stopPropagation();
});
});
/**
@ -3514,13 +3532,27 @@ Functions.showIndexEditDialog = function ($outer) {
Indexes.checkIndexType();
Functions.checkIndexName('index_frm');
var $indexColumns = $('#index_columns');
$indexColumns.find('td').each(function () {
$(this).css('width', $(this).width() + 'px');
});
$indexColumns.find('tbody').sortable({
axis: 'y',
containment: $indexColumns.find('tbody'),
tolerance: 'pointer'
tolerance: 'pointer',
forcePlaceholderSize: true,
// Add custom dragged row
helper: function (event, tr) {
var $originalCells = tr.children();
var $helper = tr.clone();
$helper.children().each(function (index) {
// Set cell width in dragged row
$(this).width($originalCells.eq(index).outerWidth());
var $childrenSelect = $originalCells.eq(index).children('select');
if ($childrenSelect.length) {
var selectedIndex = $childrenSelect.prop('selectedIndex');
// Set correct select value in dragged row
$(this).children('select').prop('selectedIndex', selectedIndex);
}
});
return $helper;
}
});
Functions.showHints($outer);
// Add a slider for selecting how many columns to add to the index
@ -3788,14 +3820,22 @@ AJAX.registerOnload('functions.js', function () {
// Sync favorite tables from localStorage to pmadb.
if ($('#sync_favorite_tables').length) {
var favoriteTables = '';
if (isStorageSupported('localStorage')
&& typeof window.localStorage.favoriteTables !== 'undefined'
&& window.localStorage.favoriteTables !== 'undefined') {
favoriteTables = window.localStorage.favoriteTables;
if (favoriteTables === 'undefined') {
// Do not send an invalid value
return;
}
}
$.ajax({
url: $('#sync_favorite_tables').attr('href'),
cache: false,
type: 'POST',
data: {
'favoriteTables': (isStorageSupported('localStorage') && typeof window.localStorage.favoriteTables !== 'undefined')
? window.localStorage.favoriteTables
: '',
'favoriteTables': favoriteTables,
'server': CommonParams.get('server'),
'no_debug': true
},
@ -4148,9 +4188,14 @@ $(function () {
/**
* Scrolls the page to the top if clicking the server-breadcrumb bar
* If the user holds the Ctrl (or Meta on macOS) key, it prevents the scroll
* so they can open the link in a new tab.
*/
$(function () {
$(document).on('click', '#server-breadcrumb, #goto_pagetop', function (event) {
if (event.ctrlKey || event.metaKey) {
return;
}
event.preventDefault();
$('html, body').animate({ scrollTop: 0 }, 'fast');
});
@ -4396,21 +4441,24 @@ Functions.ignorePhpErrors = function (clearPrevErrors) {
* @param $inputField
*/
Functions.toggleDatepickerIfInvalid = function ($td, $inputField) {
// Regex allowed by the Datetimepicker UI
var dtexpDate = new RegExp(['^([0-9]{4})',
'-(((01|03|05|07|08|10|12)-((0[1-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)',
'-((0[1-9])|([1-2][0-9])|30)))$'].join(''));
var dtexpTime = new RegExp(['^(([0-1][0-9])|(2[0-3]))',
':((0[0-9])|([1-5][0-9]))',
':((0[0-9])|([1-5][0-9]))(.[0-9]{1,6}){0,1}$'].join(''));
// If the Datetimepicker UI is not present, return
if ($inputField.hasClass('hasDatepicker')) {
// Regex allowed by the Datetimepicker UI
var dtexpDate = new RegExp(['^([0-9]{4})',
'-(((01|03|05|07|08|10|12)-((0[1-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)',
'-((0[1-9])|([1-2][0-9])|30)))$'].join(''));
var dtexpTime = new RegExp(['^(([0-1][0-9])|(2[0-3]))',
':((0[0-9])|([1-5][0-9]))',
':((0[0-9])|([1-5][0-9]))(.[0-9]{1,6}){0,1}$'].join(''));
// If key-ed in Time or Date values are unsupported by the UI, close it
if ($td.attr('data-type') === 'date' && ! dtexpDate.test($inputField.val())) {
$inputField.datepicker('hide');
} else if ($td.attr('data-type') === 'time' && ! dtexpTime.test($inputField.val())) {
$inputField.datepicker('hide');
} else {
$inputField.datepicker('show');
// If key-ed in Time or Date values are unsupported by the UI, close it
if ($td.attr('data-type') === 'date' && ! dtexpDate.test($inputField.val())) {
$inputField.datepicker('hide');
} else if ($td.attr('data-type') === 'time' && ! dtexpTime.test($inputField.val())) {
$inputField.datepicker('hide');
} else {
$inputField.datepicker('show');
}
}
};

View File

@ -62,10 +62,14 @@ function prepareJSVersion () {
function addDataPoint (pointNumber, prefix) {
return '<br>' +
Functions.sprintf(Messages.strPointN, (pointNumber + 1)) + ': ' +
'<label for="x">' + Messages.strX + '</label>' +
'<input type="text" name="' + prefix + '[' + pointNumber + '][x]" value="">' +
'<label for="y">' + Messages.strY + '</label>' +
'<input type="text" name="' + prefix + '[' + pointNumber + '][y]" value="">';
'<label>' +
Messages.strX +
' <input type="text" name="' + prefix + '[' + pointNumber + '][x]" value="">' +
'</label>' +
' <label>' +
Messages.strY +
' <input type="text" name="' + prefix + '[' + pointNumber + '][y]" value="">' +
'</label> ';
}
/**
@ -158,30 +162,15 @@ function loadGISEditor (value, field, type, inputName) {
*/
// eslint-disable-next-line no-unused-vars
function openGISEditor () {
// Center the popup
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupWidth = windowWidth * 0.9;
var popupHeight = windowHeight * 0.9;
var popupOffsetTop = windowHeight / 2 - popupHeight / 2;
var popupOffsetLeft = windowWidth / 2 - popupWidth / 2;
var $gisEditor = $('#gis_editor');
var $background = $('#popup_background');
$gisEditor.css({ 'top': popupOffsetTop, 'left': popupOffsetLeft, 'width': popupWidth, 'height': popupHeight });
$background.css({ 'opacity' : '0.7' });
$gisEditor.append(
'<div id="gis_data_editor">' +
'<img class="ajaxIcon" id="loadingMonitorIcon" src="' +
themeImagePath + 'ajax_clock_small.gif" alt="">' +
'</div>'
);
// Make it appear
$background.fadeIn('fast');
$gisEditor.fadeIn('fast');
$('#popup_background').fadeIn('fast');
$('#gis_editor')
.append(
'<div id="gis_data_editor">' +
'<img class="ajaxIcon" id="loadingMonitorIcon" src="' +
themeImagePath + 'ajax_clock_small.gif" alt="">' +
'</div>'
)
.fadeIn('fast');
}
/**
@ -213,7 +202,7 @@ AJAX.registerTeardown('gis_data_editor.js', function () {
$(document).off('change', '#gis_editor select.gis_type');
$(document).off('click', '#gis_editor a.close_gis_editor, #gis_editor a.cancel_gis_editor');
$(document).off('click', '#gis_editor a.addJs.addPoint');
$(document).off('click', '#gis_editor a.addLine.addJs');
$(document).off('click', '#gis_editor a.addJs.addLine');
$(document).off('click', '#gis_editor a.addJs.addPolygon');
$(document).off('click', '#gis_editor a.addJs.addGeom');
});
@ -302,7 +291,7 @@ AJAX.registerOnload('gis_data_editor.js', function () {
/**
* Handles adding linestrings and inner rings
*/
$(document).on('click', '#gis_editor a.addLine.addJs', function () {
$(document).on('click', '#gis_editor a.addJs.addLine', function () {
var $a = $(this);
var name = $a.attr('name');
@ -328,7 +317,7 @@ AJAX.registerOnload('gis_data_editor.js', function () {
for (var i = 0; i < noOfPoints; i++) {
html += addDataPoint(i, (prefix + '[' + noOfLines + ']'));
}
html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfLines + '][add_point]" href="#">+ ' +
html += '<a class="btn btn-secondary addPoint addJs" name="' + prefix + '[' + noOfLines + '][add_point]" href="#">+ ' +
Messages.strAddPoint + '</a><br>';
$a.before(html);
@ -355,9 +344,9 @@ AJAX.registerOnload('gis_data_editor.js', function () {
for (var i = 0; i < 4; i++) {
html += addDataPoint(i, (prefix + '[' + noOfPolygons + '][0]'));
}
html += '<a class="addPoint addJs" name="' + prefix + '[' + noOfPolygons + '][0][add_point]" href="#">+ ' +
html += '<a class="btn btn-secondary addPoint addJs" name="' + prefix + '[' + noOfPolygons + '][0][add_point]" href="#">+ ' +
Messages.strAddPoint + '</a><br>' +
'<a class="addLine addJs" name="' + prefix + '[' + noOfPolygons + '][add_line]" href="#">+ ' +
'<a class="btn btn-secondary addLine addJs" name="' + prefix + '[' + noOfPolygons + '][add_line]" href="#">+ ' +
Messages.strAddInnerRing + '</a><br><br>';
$a.before(html);
@ -375,18 +364,20 @@ AJAX.registerOnload('gis_data_editor.js', function () {
var noOfGeoms = parseInt($noOfGeomsInput.val(), 10);
var html1 = Messages.strGeometry + ' ' + (noOfGeoms + 1) + ':<br>';
var $geomType = $('select[name=\'gis_data[' + (noOfGeoms - 1) + '][gis_type]\']').clone();
var $geomType = $('#gis_type_template').contents().filter('select').clone();
$geomType.attr('name', 'gis_data[' + noOfGeoms + '][gis_type]').val('POINT');
var html2 = '<br>' + Messages.strPoint + ' :' +
'<label for="x"> ' + Messages.strX + ' </label>' +
'<input type="text" name="gis_data[' + noOfGeoms + '][POINT][x]" value="">' +
'<label for="y"> ' + Messages.strY + ' </label>' +
'<input type="text" name="gis_data[' + noOfGeoms + '][POINT][y]" value="">' +
var html2 = '<br>' + Messages.strPoint + ': ' +
'<label>' +
Messages.strX +
' <input type="text" name="gis_data[' + noOfGeoms + '][POINT][x]" value="">' +
'</label>' +
' <label>' +
Messages.strY +
' <input type="text" name="gis_data[' + noOfGeoms + '][POINT][y]" value="">' +
'</label>' +
'<br><br>';
$a.before(html1);
$geomType.insertBefore($a);
$a.before(html2);
$a.before(html1, $geomType, html2);
$noOfGeomsInput.val(noOfGeoms + 1);
});
});

View File

@ -105,13 +105,15 @@ const GitInfo = {
'server': CommonParams.get('server'),
'ajax_request': true,
'no_debug': true
},
function (data) {
if (typeof data !== 'undefined' && data.success === true) {
$(data.message).insertAfter('#li_pma_version');
}
}
);
).done(function (data) {
if (typeof data !== 'undefined' && data.success === true) {
$(data.message).insertAfter('#li_pma_version');
}
}).fail(function () {
const gitHashInfoLi = '<li id="li_pma_version_git" class="list-group-item">' + window.Messages.errorLoadingGitInformation + '</li>';
$(gitHashInfoLi).insertAfter('#li_pma_version');
});
}
};
@ -121,9 +123,15 @@ AJAX.registerTeardown('home.js', function () {
AJAX.registerOnload('home.js', function () {
$('#themesModal').on('show.bs.modal', function () {
$.get('index.php?route=/themes', function (data) {
$('#themesModal .modal-body').html(data.themes);
});
$.get(
'index.php?route=/themes',
{
'server': CommonParams.get('server'),
},
function (data) {
$('#themesModal .modal-body').html(data.themes);
}
);
});
/**

View File

@ -16,9 +16,11 @@ function changePluginOpts () {
$('#' + selectedPluginName + '_options').fadeIn('slow');
const importNotification = document.getElementById('import_notification');
importNotification.innerText = '';
if (selectedPluginName === 'csv') {
importNotification.innerHTML = '<div class="alert alert-info mb-0 mt-3" role="alert">' + Messages.strImportCSV + '</div>';
if (importNotification) {
importNotification.innerText = '';
if (selectedPluginName === 'csv') {
importNotification.innerHTML = '<div class="alert alert-info mb-0 mt-3" role="alert">' + Messages.strImportCSV + '</div>';
}
}
}

View File

@ -159,17 +159,21 @@ Indexes.removeColumnFromIndex = function (colIndex) {
return;
}
// Remove column from index array.
var sourceLength = sourceArray[previousIndex[1]].columns.length;
for (var i = 0; i < sourceLength; i++) {
if (sourceArray[previousIndex[1]].columns[i].col_index === colIndex) {
sourceArray[previousIndex[1]].columns.splice(i, 1);
if (previousIndex[1] in sourceArray) {
// Remove column from index array.
var sourceLength = sourceArray[previousIndex[1]].columns.length;
for (var i = 0; i < sourceLength; i++) {
if (i in sourceArray[previousIndex[1]].columns) {
if (sourceArray[previousIndex[1]].columns[i].col_index === colIndex) {
sourceArray[previousIndex[1]].columns.splice(i, 1);
}
}
}
}
// Remove index completely if no columns left.
if (sourceArray[previousIndex[1]].columns.length === 0) {
sourceArray.splice(previousIndex[1], 1);
// Remove index completely if no columns left.
if (sourceArray[previousIndex[1]].columns.length === 0) {
sourceArray.splice(previousIndex[1], 1);
}
}
// Update current index details.
@ -228,7 +232,7 @@ Indexes.addColumnToIndex = function (sourceArray, arrayIndex, indexChoice, colIn
$.each(columns, function () {
columnNames.push($('input[name="field_name[' + this.col_index + ']"]').val());
});
displayName = '[' + columnNames.join(', ') + ']';
displayName = '[' + columnNames.join(', ').trimRight() + ']';
}
$.each(columns, function () {
var id = 'index_name_' + this.col_index + '_8';
@ -773,7 +777,7 @@ AJAX.registerOnload('indexes.js', function () {
if (indexChoice === 'none') {
Indexes.removeColumnFromIndex(colIndex);
var id = 'index_name_' + '0' + '_8';
var id = 'index_name_' + colIndex + '_8';
var $name = $('#' + id);
if ($name.length === 0) {
$name = $('<a id="' + id + '" href="#" class="ajax show_index_dialog"></a>');
@ -825,7 +829,11 @@ AJAX.registerOnload('indexes.js', function () {
var arrayIndex = previousIndex[1];
var sourceArray = Indexes.getIndexArray(indexChoice);
if (sourceArray !== null) {
if (sourceArray === null) {
return;
}
if (arrayIndex in sourceArray) {
var sourceLength = sourceArray[arrayIndex].columns.length;
var targetColumns = [];

View File

@ -845,7 +845,9 @@ var makeGrid = function (t, enableResize, enableReorder, enableVisib, enableGrid
});
} else {
$(g.cEdit).on('keypress change paste', '.edit_box', function () {
$checkbox.prop('checked', false);
if ($(this).val() !== '') {
$checkbox.prop('checked', false);
}
});
// Capture ctrl+v (on IE and Chrome)
$(g.cEdit).on('keydown', '.edit_box', function (e) {
@ -879,6 +881,8 @@ var makeGrid = function (t, enableResize, enableReorder, enableVisib, enableGrid
if ($editArea.find('select').length > 0) {
$editArea.find('select').val('');
}
} else if ($td.is('.datefield')) {
$('.ui-datepicker-trigger').trigger('click');
} else {
$editArea.find('textarea').val('');
}
@ -1215,7 +1219,11 @@ var makeGrid = function (t, enableResize, enableReorder, enableVisib, enableGrid
whereClause = '';
}
fullWhereClause.push(whereClause);
var conditionArray = JSON.parse($tr.find('.condition_array').val());
var conditionArrayContent = $tr.find('.condition_array').val();
if (typeof conditionArrayContent === 'undefined') {
conditionArrayContent = '{}';
}
var conditionArray = JSON.parse(conditionArrayContent);
/**
* multi edit variables, for current row
@ -1514,7 +1522,7 @@ var makeGrid = function (t, enableResize, enableReorder, enableVisib, enableGrid
isValueUpdated = thisFieldParams[fieldName] !== Functions.getCellValue(g.currentEditCell);
} else {
const JSONString = Functions.stringifyJSON(thisFieldParams[fieldName]);
isValueUpdated = JSONString !== JSON.stringify(JSON.parse(Functions.getCellValue(g.currentEditCell)));
isValueUpdated = JSONString !== Functions.stringifyJSON(Functions.getCellValue(g.currentEditCell));
}
if (g.wasEditedCellNull || isValueUpdated) {
@ -2054,8 +2062,8 @@ var makeGrid = function (t, enableResize, enableReorder, enableVisib, enableGrid
}
});
$(g.t).find('td.data.click2')
.on('click', function (e) {
$(g.t)
.on('click', 'td.data.click2', function (e) {
var $cell = $(this);
// In the case of relational link, We want single click on the link
// to goto the link and double click to start grid-editing.
@ -2089,7 +2097,7 @@ var makeGrid = function (t, enableResize, enableReorder, enableVisib, enableGrid
}
}
})
.on('dblclick', function (e) {
.on('dblclick', 'td.data.click2', function (e) {
if ($(e.target).is('.grid_edit a')) {
e.preventDefault();
} else {
@ -2180,14 +2188,17 @@ var makeGrid = function (t, enableResize, enableReorder, enableVisib, enableGrid
// wrap all truncated data cells with span indicating the original length
// todo update the original length after a grid edit
$(t).find('td.data.truncated:not(:has(span))')
$(t).find('td.data.truncated:not(:has(>span))')
.filter(function () {
return $(this).data('originallength') !== undefined;
})
.wrapInner(function () {
return '<span title="' + Messages.strOriginalLength + ' ' +
$(this).data('originallength') + '"></span>';
});
// wrap remaining cells, except actions cell, with span
$(t).find('th, td:not(:has(span))')
$(t).find('th, td:not(:has(>span))')
.wrapInner('<span></span>');
// create grid elements

View File

@ -185,7 +185,7 @@ Navigation.loadChildNodes = function (isNode, $expandElem, callback) {
if (data.errors) {
var $errors = $(data.errors);
if ($errors.children().length > 0) {
$('#pma_errors').replaceWith(data.errors);
$('#pma_errors').append(data.errors);
}
}
if (callback && typeof callback === 'function') {

View File

@ -16,7 +16,7 @@
* @return {bool} whether the form is validated or not
*/
function checkAddUser (theForm) {
if (theForm.elements.hostname.value === '') {
if (theForm.elements.hostname && theForm.elements.hostname.value === '') {
alert(Messages.strHostEmpty);
theForm.elements.hostname.focus();
return false;

View File

@ -570,6 +570,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
saveMonitor(); // Save settings
$('#closeModalButton').off('click');
$('#addChartButton').off('click');
});
$('#closeModalButton').on('click', function () {
@ -577,6 +578,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
$('span#clearSeriesLink').hide();
$('#seriesPreview').html('');
$('#closeModalButton').off('click');
$('#addChartButton').off('click');
});
var $presetList = $('#addChartModal').find('select[name="presetCharts"]');
@ -716,7 +718,9 @@ AJAX.registerOnload('server/status/monitor.js', function () {
$('#emptyDialog').dialog('close');
};
reader.readAsText(input.files[0]);
if (input.files[0]) {
reader.readAsText(input.files[0]);
}
};
dlgBtns[Messages.strCancel].click = function () {

View File

@ -21,7 +21,7 @@ AJAX.registerOnload('server/user_groups.js', function () {
const userGroupName = $(event.relatedTarget).data('user-group');
this.querySelector('.modal-body').innerText = Functions.sprintf(
Messages.strDropUserGroupWarning,
Functions.escapeHtml(userGroupName)
userGroupName
);
});
deleteUserGroupModal.on('shown.bs.modal', function (event) {

View File

@ -189,7 +189,7 @@ AJAX.registerTeardown('sql.js', function () {
$(document).off('click', 'a.delete_row.ajax');
$(document).off('submit', '.bookmarkQueryForm');
$('input#bkm_label').off('input');
$(document).off('makegrid', '.sqlqueryresults');
$(document).off('makeGrid', '.sqlqueryresults');
$('#togglequerybox').off('click');
$(document).off('click', '#button_submit_query');
$(document).off('change', '#id_bookmark');
@ -377,6 +377,9 @@ AJAX.registerOnload('sql.js', function () {
textArea.value += '\n';
$('.table_results tbody tr').each(function () {
if ($(this).hasClass('repeating_header_row')) {
return;
}
$(this).find('.data span').each(function () {
// Extract <em> tag for NULL values before converting to string to not mess up formatting
var data = $(this).find('em').length !== 0 ? $(this).find('em')[0] : this;
@ -401,11 +404,11 @@ AJAX.registerOnload('sql.js', function () {
}); // end of Copy to Clipboard action
/**
* Attach the {@link makegrid} function to a custom event, which will be
* Attach the {@link makeGrid} function to a custom event, which will be
* triggered manually everytime the table of results is reloaded
* @memberOf jQuery
*/
$(document).on('makegrid', '.sqlqueryresults', function () {
$(document).on('makeGrid', '.sqlqueryresults', function () {
$('.table_results').each(function () {
makeGrid(this);
});
@ -625,7 +628,7 @@ AJAX.registerOnload('sql.js', function () {
});
}
$('.sqlqueryresults').trigger('makegrid');
$('.sqlqueryresults').trigger('makeGrid');
$('#togglequerybox').show();
if (typeof data.action_bookmark === 'undefined') {
@ -663,7 +666,7 @@ AJAX.registerOnload('sql.js', function () {
var $sqlqueryresults = $form.parents('.sqlqueryresults');
$sqlqueryresults
.html(data.message)
.trigger('makegrid');
.trigger('makeGrid');
Functions.highlightSql($sqlqueryresults);
}); // end $.post()
}); // end displayOptionsForm handler
@ -761,7 +764,7 @@ AJAX.registerOnload('sql.js', function () {
for (var i = 0; i < len; i++) {
dialogContent += '<strong>' + Messages.strSQLQuery +
'</strong>' + response.sql_data[i].sql_query +
Messages.strMatchedRows +
Messages.strAffectedRows +
' <a href="' + response.sql_data[i].matched_rows_url +
'">' + response.sql_data[i].matched_rows + '</a><br>';
if (i < len - 1) {
@ -1014,7 +1017,7 @@ AJAX.registerOnload('sql.js', function () {
/**
* create resizable table
*/
$('.sqlqueryresults').trigger('makegrid');
$('.sqlqueryresults').trigger('makeGrid');
/**
* Check if there is any saved query

View File

@ -176,13 +176,28 @@ function verifyAfterSearchFieldChange (index, searchFormId) {
});
// validator method for IN(...), NOT IN(...)
// BETWEEN and NOT BETWEEN
// See all possible syntaxes in tests of https://regexr.com/7h1eq
jQuery.validator.addMethod('validationFunctionForMultipleInt', function (value) {
return value.match(/^(?:(?:\d\s*)|\s*)+(?:,\s*\d+)*$/i) !== null;
if (value === '') {
return true;
}
return value.replace(/ /g,'').match(/^(((0x[0-9a-f]+)|([+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)(e[+-]?[0-9]+)?))(,|$))+$/i) !== null;
},
Messages.strEnterValidNumber
);
validateMultipleIntField($thisInput, true);
} else {
// validator method for INTs
// See all possible syntaxes in tests of https://regexr.com/7h1ci
jQuery.validator.addMethod('validationFunctionForInt', function (value) {
if (value === '') {
return true;
}
return value.match(/^(0x[0-9a-f]+$)|([+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)(e[+-]?[0-9]+)?)$/i) !== null;
},
Messages.strEnterValidNumber
);
$(searchFormId).validate({
// update errors as we write
onkeyup: function (element) {
@ -229,8 +244,8 @@ function validateIntField (jqueryInput, returnValueIfIsNumber) {
jqueryInput.rules('remove');
jqueryInput.rules('add', {
number: {
param: true,
validationFunctionForInt: {
param: jqueryInput.value,
depends: function () {
return returnValueIfIsNumber;
}
@ -293,30 +308,42 @@ function verificationsAfterFieldChange (urlField, multiEdit, theType) {
$('#salt_' + target.id).remove();
}
// Remove possible blocking rules if the user changed functions
$('#' + target.id).rules('remove', 'validationFunctionForMd5');
$('#' + target.id).rules('remove', 'validationFunctionForAesDesEncrypt');
if (target.value === 'MD5') {
$('#' + target.id).rules('add', {
validationFunctionForMd5: {
param: $thisInput,
depends: function () {
return checkForCheckbox(multiEdit);
}
}
});
var couldFetchRules = false;
try {
// See: issue #18792 - In some weird cases the input goes away before it validates
// And it breaks jquery, this is a well known jquery bug with different trigger schemes
$('#' + target.id).rules();
couldFetchRules = true;
} catch (error) {
console.log(error);
}
if (target.value === 'DES_ENCRYPT' || target.value === 'AES_ENCRYPT') {
$('#' + target.id).rules('add', {
validationFunctionForAesDesEncrypt: {
param: $thisInput,
depends: function () {
return checkForCheckbox(multiEdit);
if (couldFetchRules) {
// Remove possible blocking rules if the user changed functions
$('#' + target.id).rules('remove', 'validationFunctionForMd5');
$('#' + target.id).rules('remove', 'validationFunctionForAesDesEncrypt');
if (target.value === 'MD5') {
$('#' + target.id).rules('add', {
validationFunctionForMd5: {
param: $thisInput,
depends: function () {
return checkForCheckbox(multiEdit);
}
}
}
});
});
}
if (target.value === 'DES_ENCRYPT' || target.value === 'AES_ENCRYPT') {
$('#' + target.id).rules('add', {
validationFunctionForAesDesEncrypt: {
param: $thisInput,
depends: function () {
return checkForCheckbox(multiEdit);
}
}
});
}
}
if (target.value === 'HEX' && theType.substring(0,3) === 'int') {

View File

@ -338,7 +338,7 @@ AJAX.registerOnload('table/gis_visualization.js', function () {
* Detect the mousemove event and show tooltips.
*/
$('.vector').on('mousemove', function (event) {
var contents = Functions.escapeHtml($(this).attr('name')).trim();
var contents = Functions.escapeHtml($(this).attr('data-label')).trim();
$('#tooltip').remove();
if (contents !== '') {
$('<div id="tooltip">' + contents + '</div>').css({

View File

@ -161,7 +161,7 @@ AJAX.registerOnload('table/select.js', function () {
$('#sqlqueryresultsouter').html(data.sql_query);
} else { // results found
$('#sqlqueryresultsouter').html(data.message);
$('.sqlqueryresults').trigger('makegrid');
$('.sqlqueryresults').trigger('makeGrid');
}
$('#tbl_search_form')
// workaround for bug #3168569 - Issue on toggling the "Hide search criteria" in chrome.
@ -182,7 +182,7 @@ AJAX.registerOnload('table/select.js', function () {
});
// Following section is related to the 'function based search' for geometry data types.
// Initially hide all the open_gis_editor spans
// Initially hide all the open_search_gis_editor spans
$('span.open_search_gis_editor').hide();
$('select.geom_func').on('change', function () {
@ -251,13 +251,15 @@ AJAX.registerOnload('table/select.js', function () {
var field = 'Parameter';
// Column type
var geomFunc = $span.parents('tr').find('.geom_func').val();
var type;
if (geomFunc === 'Envelope') {
type = 'polygon';
} else if (geomFunc === 'ExteriorRing') {
type = 'linestring';
} else {
type = 'point';
var type = 'GEOMETRY';
if (!value) {
if (geomFunc === 'Envelope') {
value = 'POLYGON()';
} else if (geomFunc === 'ExteriorRing') {
value = 'LINESTRING()';
} else {
value = 'POINT()';
}
}
// Names of input field and null checkbox
var inputName = $span.parent('td').children('input[type=\'text\']').attr('name');

View File

@ -322,9 +322,15 @@ AJAX.registerOnload('table/structure.js', function () {
designerModalPreviewModal.addEventListener('shown.bs.modal', () => {
const modalBody = designerModalPreviewModal.querySelector('.modal-body');
const $form = $('#move_column_form');
const serialized = $form.serialize();
if (serialized === $form.data('serialized-unmoved')) {
modalBody.innerHTML = '';
return;
}
const formUrl = $form.attr('action');
const sep = CommonParams.get('arg_separator');
const formData = $form.serialize() +
const formData = serialized +
sep + 'preview_sql=1' +
sep + 'ajax_request=1';
$.post({

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
/*!
* jQuery Validation Plugin v1.19.5
* jQuery Validation Plugin v1.21.0
*
* https://jqueryvalidation.org/
*
* Copyright (c) 2022 Jörn Zaefferer
* Copyright (c) 2024 Jörn Zaefferer
* Released under the MIT license
*/
(function( factory ) {
@ -1459,46 +1459,39 @@ $.validator.addMethod( "url2", function( value, element ) {
* @cat Plugins/Validate/Methods
*/
$.validator.addMethod( "vinUS", function( v ) {
if ( v.length !== 17 ) {
return false;
}
if ( v.length !== 17 ) {
return false;
}
var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ],
VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ],
FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ],
rs = 0,
i, n, d, f, cd, cdv;
var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ],
VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ],
FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ],
rs = 0,
i, n, d, f, cd, cdv;
for ( i = 0; i < 17; i++ ) {
f = FL[ i ];
d = v.slice( i, i + 1 );
if ( i === 8 ) {
cdv = d;
}
if ( !isNaN( d ) ) {
d *= f;
} else {
for ( n = 0; n < LL.length; n++ ) {
if ( d.toUpperCase() === LL[ n ] ) {
d = VL[ n ];
d *= f;
if ( isNaN( cdv ) && n === 8 ) {
cdv = LL[ n ];
}
break;
}
}
}
rs += d;
}
cd = rs % 11;
if ( cd === 10 ) {
cd = "X";
}
if ( cd === cdv ) {
return true;
}
return false;
for ( i = 0; i < 17; i++ ) {
f = FL[ i ];
d = v.slice( i, i + 1 );
if ( isNaN( d ) ) {
d = d.toUpperCase();
n = VL[ LL.indexOf( d ) ];
} else {
n = parseInt( d, 10 );
}
if ( i === 8 )
{
cdv = n;
if ( d === "X" ) {
cdv = 10;
}
}
rs += n * f;
}
cd = rs % 11;
if ( cd === cdv ) {
return true;
}
return false;
}, "The specified vehicle identification number (VIN) is invalid." );
$.validator.addMethod( "zipcodeUS", function( value, element ) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

17
js/vendor/sprintf.js vendored
View File

@ -1,5 +1,5 @@
/**
* Copyright (c) 2007-2016 Kevin van Zonneveld (https://kvz.io)
* Copyright (c) 2007-2024 Kevin van Zonneveld (https://kvz.io)
* and Contributors (https://locutus.io/authors)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
@ -61,7 +61,7 @@ function sprintf () {
if (!chr) {
chr = ' '
}
var padding = (str.length >= len) ? '' : new Array(1 + len - str.length >>> 0).join(chr)
const padding = str.length >= len ? '' : new Array((1 + len - str.length) >>> 0).join(chr)
return leftJustify ? str + padding : padding + str
}
@ -72,11 +72,7 @@ function sprintf () {
// on the left side
// keep sign (+ or -) in front
if (!leftJustify && padChar === '0') {
value = [
value.slice(0, prefix.length),
_pad('', diff, '0', true),
value.slice(prefix.length)
].join('')
value = [value.slice(0, prefix.length), _pad('', diff, '0', true), value.slice(prefix.length)].join('')
} else {
value = _pad(value, minWidth, padChar, leftJustify)
}
@ -145,7 +141,7 @@ function sprintf () {
}
if (!precision) {
precision = (specifier === 'd') ? 0 : 'fFeE'.indexOf(specifier) > -1 ? 6 : undefined
precision = specifier === 'd' ? 0 : 'fFeE'.indexOf(specifier) > -1 ? 6 : undefined
} else {
precision = +precision
}
@ -174,15 +170,14 @@ function sprintf () {
case 'x':
return _formatBaseX(value, 16, leftJustify, minWidth, precision, padChar)
case 'X':
return _formatBaseX(value, 16, leftJustify, minWidth, precision, padChar)
.toUpperCase()
return _formatBaseX(value, 16, leftJustify, minWidth, precision, padChar).toUpperCase()
case 'u':
return _formatBaseX(value, 10, leftJustify, minWidth, precision, padChar)
case 'i':
case 'd':
number = +value || 0
// Plain Math.round doesn't just truncate
number = Math.round(number - number % 1)
number = Math.round(number - (number % 1))
prefix = number < 0 ? '-' : positiveNumberPrefix
value = prefix + _pad(String(Math.abs(number)), precision, '0', false)

2654
js/vendor/tracekit.js vendored

File diff suppressed because it is too large Load Diff

849
js/vendor/zxcvbn-ts.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -305,7 +305,12 @@ class Bookmark
$query = 'SELECT * FROM ' . Util::backquote($bookmarkFeature->database)
. '.' . Util::backquote($bookmarkFeature->bookmark)
. " WHERE dbase = '" . $dbi->escapeString($db) . "'";
. ' WHERE ' . Util::backquote($id_field)
. " = '" . $dbi->escapeString((string) $id) . "'";
if ($db !== '') {
$query .= " AND dbase = '" . $dbi->escapeString($db) . "'";
}
if (! $action_bookmark_all) {
$query .= " AND (user = '"
. $dbi->escapeString($user) . "'";
@ -316,8 +321,7 @@ class Bookmark
$query .= ')';
}
$query .= ' AND ' . Util::backquote($id_field)
. " = '" . $dbi->escapeString((string) $id) . "' LIMIT 1";
$query .= ' LIMIT 1';
$result = $dbi->fetchSingleRow($query, DatabaseInterface::FETCH_ASSOC, DatabaseInterface::CONNECT_CONTROL);
if (! empty($result)) {

View File

@ -114,16 +114,31 @@ class Charsets
return;
}
$sql = 'SELECT `COLLATION_NAME` AS `Collation`,'
. ' `CHARACTER_SET_NAME` AS `Charset`,'
. ' `ID` AS `Id`,'
. ' `IS_DEFAULT` AS `Default`,'
. ' `IS_COMPILED` AS `Compiled`,'
. ' `SORTLEN` AS `Sortlen`'
. ' FROM `information_schema`.`COLLATIONS`';
if ($dbi->isMariaDB() && $dbi->getVersion() >= 101000) {
/* Use query to accommodate new structure of MariaDB collations.
Note, that SHOW COLLATION command is not applicable at the time of writing.
Refer https://jira.mariadb.org/browse/MDEV-27009 */
$sql = 'SELECT `collapp`.`FULL_COLLATION_NAME` AS `Collation`,'
. ' `collapp`.`CHARACTER_SET_NAME` AS `Charset`,'
. ' `collapp`.`ID` AS `Id`,'
. ' `collapp`.`IS_DEFAULT` AS `Default`,'
. ' `coll`.`IS_COMPILED` AS `Compiled`,'
. ' `coll`.`SORTLEN` AS `Sortlen`'
. ' FROM `information_schema`.`COLLATION_CHARACTER_SET_APPLICABILITY` `collapp`'
. ' LEFT JOIN `information_schema`.`COLLATIONS` `coll`'
. ' ON `collapp`.`COLLATION_NAME`=`coll`.`COLLATION_NAME`';
} else {
$sql = 'SELECT `COLLATION_NAME` AS `Collation`,'
. ' `CHARACTER_SET_NAME` AS `Charset`,'
. ' `ID` AS `Id`,'
. ' `IS_DEFAULT` AS `Default`,'
. ' `IS_COMPILED` AS `Compiled`,'
. ' `SORTLEN` AS `Sortlen`'
. ' FROM `information_schema`.`COLLATIONS`';
if ($disableIs) {
$sql = 'SHOW COLLATION';
if ($disableIs) {
$sql = 'SHOW COLLATION';
}
}
$res = $dbi->query($sql);

View File

@ -4,11 +4,14 @@ declare(strict_types=1);
namespace PhpMyAdmin\Command;
use PhpMyAdmin\Git;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use function addcslashes;
use function explode;
use function file_put_contents;
use function is_string;
use function shell_exec;
@ -34,9 +37,21 @@ declare(strict_types=1);
*/
return [
'revision' => '%s',
'revisionHash' => '%s',
'revisionUrl' => '%s',
'branch' => '%s',
'branchUrl' => '%s',
'message' => '%s',
'author' => [
'name' => '%s',
'email' => '%s',
'date' => '%s',
],
'committer' => [
'name' => '%s',
'email' => '%s',
'date' => '%s',
],
];
PHP;
@ -101,14 +116,31 @@ PHP;
return null;
}
$branchName = trim(str_replace('refs/heads/', '', $branchName));
$commitDetails = $this->gitCli(
'show -s --pretty="tree %T%nparent %P%nauthor %an <%ae> %at%ncommitter %cn <%ce> %ct%n%n%B"'
);
if ($commitDetails === null) {
return null;
}
$branchName = addcslashes(trim(str_replace('refs/heads/', '', $branchName)), "'");
[$author, $committer, $message] = Git::extractDataFormTextBody(explode("\n", $commitDetails));
return sprintf(
self::$generatedClassTemplate,
trim($revisionText),
trim($commitHash),
sprintf($commitUrlFormat, trim($commitHash)),
trim($branchName),
sprintf($branchUrlFormat, $branchName)
$branchName,
sprintf($branchUrlFormat, $branchName),
addcslashes(trim($message), "'"), // Commit message
addcslashes($author['name'], "'"), // Author name
addcslashes($author['email'], "'"), // Author email
$author['date'], // Author date
addcslashes($committer['name'], "'"), // Committer name
addcslashes($committer['email'], "'"), // Committer email
$committer['date'] // Committer date
);
}

View File

@ -312,6 +312,13 @@ final class Common
Core::warnMissingExtension('mbstring');
}
/**
* Warning about mysqlnd. This does not apply to PMA >= 6.0
*/
if (! function_exists('mysqli_stmt_get_result')) {
Core::warnMissingExtension('mysqlnd');
}
/**
* We really need this one!
*/

View File

@ -1023,7 +1023,7 @@ class Config
*/
public function getCookieName(string $cookieName): string
{
return $cookieName . ( $this->isHttps() ? '_https' : '' );
return ($this->isHttps() ? '__Secure-' : '') . $cookieName . ($this->isHttps() ? '_https' : '');
}
/**

View File

@ -9,7 +9,6 @@ use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Dbal\DatabaseName;
use PhpMyAdmin\Dbal\TableName;
use PhpMyAdmin\InternalRelations;
use PhpMyAdmin\RecentFavoriteTable;
use PhpMyAdmin\SqlParser\Parser;
use PhpMyAdmin\SqlParser\Statements\CreateStatement;
use PhpMyAdmin\SqlParser\Utils\Table as TableUtils;
@ -163,6 +162,10 @@ class Relation
*/
private function fillRelationParamsWithTableNames(array $relationParams): ?array
{
if ($this->arePmadbTablesAllDisabled()) {
return null;
}
$tabQuery = 'SHOW TABLES FROM '
. Util::backquote($GLOBALS['cfg']['Server']['pmadb']);
$tableRes = $this->dbi->tryQueryAsControlUser($tabQuery);
@ -441,7 +444,7 @@ class Relation
if (($source === 'both' || $source === 'foreign') && strlen($table) > 0) {
$tableObj = new Table($table, $db);
$show_create_table = $tableObj->showCreate();
if ($show_create_table) {
if ($show_create_table !== '') {
$parser = new Parser($show_create_table);
$stmt = $parser->statements[0];
$foreign['foreign_keys_data'] = [];
@ -1580,6 +1583,10 @@ class Relation
*/
public function fixPmaTables($db, $create = true): void
{
if ($this->arePmadbTablesAllDisabled()) {
return;
}
$tablesToFeatures = [
'pma__bookmark' => 'bookmarktable',
'pma__relation' => 'relation',
@ -1626,6 +1633,11 @@ class Relation
$createQueries = null;
$foundOne = false;
foreach ($tablesToFeatures as $table => $feature) {
if (($GLOBALS['cfg']['Server'][$feature] ?? null) === false) {
// The feature is disabled by the user in config
continue;
}
// Check if the table already exists
// use the possible replaced name first and fallback on the table name
// if no replacement exists
@ -1669,31 +1681,12 @@ class Relation
}
$GLOBALS['cfg']['Server']['pmadb'] = $db;
//NOTE: I am unsure why we do that, as it defeats the purpose of the session cache
// Unset the cache
unset($_SESSION['relation'][$GLOBALS['server']]);
$relationParameters = $this->getRelationParameters();
if (
$relationParameters->recentlyUsedTablesFeature === null
&& $relationParameters->favoriteTablesFeature === null
) {
return;
}
// Since configuration storage is updated, we need to
// re-initialize the favorite and recent tables stored in the
// session from the current configuration storage.
if ($relationParameters->favoriteTablesFeature !== null) {
$fav_tables = RecentFavoriteTable::getInstance('favorite');
$_SESSION['tmpval']['favoriteTables'][$GLOBALS['server']] = $fav_tables->getFromDb();
}
if ($relationParameters->recentlyUsedTablesFeature !== null) {
$recent_tables = RecentFavoriteTable::getInstance('recent');
$_SESSION['tmpval']['recentTables'][$GLOBALS['server']] = $recent_tables->getFromDb();
}
// Reload navi panel to update the recent/favorite lists.
$GLOBALS['reload'] = true;
// Fill back the cache
$this->getRelationParameters();
}
/**
@ -1724,6 +1717,32 @@ class Relation
];
}
/**
* Verifies that all pmadb features are disabled
*/
public function arePmadbTablesAllDisabled(): bool
{
return ($GLOBALS['cfg']['Server']['bookmarktable'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['relation'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['table_info'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['table_coords'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['column_info'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['pdf_pages'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['history'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['recent'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['favorite'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['table_uiprefs'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['tracking'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['userconfig'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['users'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['usergroups'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['navigationhiding'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['savedsearches'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['central_columns'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['designer_settings'] ?? null) === false
&& ($GLOBALS['cfg']['Server']['export_templates'] ?? null) === false;
}
/**
* Verifies if all the pmadb tables are defined
*/

View File

@ -40,7 +40,6 @@ class UserGroups
global $dbi;
$users = [];
$numRows = 0;
$userGroupSpecialChars = htmlspecialchars($userGroup);
$usersTable = Util::backquote($configurableMenusFeature->database)
@ -63,7 +62,6 @@ class UserGroups
return $template->render('server/user_groups/user_listings', [
'user_group_special_chars' => $userGroupSpecialChars,
'num_rows' => $numRows,
'users' => $users,
]);
}
@ -98,7 +96,7 @@ class UserGroups
foreach ($userGroups as $groupName => $tabs) {
$userGroupVal = [];
$userGroupVal['name'] = htmlspecialchars((string) $groupName);
$userGroupVal['name'] = $groupName;
$userGroupVal['serverTab'] = self::getAllowedTabNames($tabs, 'server');
$userGroupVal['dbTab'] = self::getAllowedTabNames($tabs, 'db');
$userGroupVal['tableTab'] = self::getAllowedTabNames($tabs, 'table');

View File

@ -31,7 +31,7 @@ class Console
*
* @var bool
*/
private $isAjax;
private $isAjax = false;
/** @var Relation */
private $relation;

View File

@ -7,8 +7,11 @@ declare(strict_types=1);
namespace PhpMyAdmin\Controllers;
use PhpMyAdmin\Core;
use function __;
use function array_keys;
use function basename;
use function file_get_contents;
use function htmlspecialchars;
use function is_readable;
@ -37,8 +40,9 @@ class ChangeLogController extends AbstractController
__(
'The %s file is not available on this system, please visit %s for more information.'
),
$filename,
'<a href="https://www.phpmyadmin.net/">phpmyadmin.net</a>'
basename($filename),
'<a href="' . Core::linkURL('https://www.phpmyadmin.net/')
. '" rel="noopener noreferrer" target="_blank">phpmyadmin.net</a>'
);
return;
@ -75,7 +79,7 @@ class ChangeLogController extends AbstractController
// CVE/CAN entries
'/((CAN|CVE)-[0-9]+-[0-9]+)/' => '<a href="url.php?url='
. 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
. 'https://www.cve.org/CVERecord?id=\\1">\\1</a>',
// PMASAentries
'/(PMASA-[0-9]+-[0-9]+)/' => '<a href="url.php?url=https://www.phpmyadmin.net/security/\\1/">\\1</a>',

View File

@ -65,7 +65,7 @@ class OperationsController extends AbstractController
public function __invoke(): void
{
global $cfg, $db, $server, $sql_query, $move, $message, $tables_full, $errorUrl;
global $cfg, $db, $server, $sql_query, $move, $message, $errorUrl;
global $export_sql_plugin, $views, $sqlConstratints, $local_query, $reload, $urlParams, $tables;
global $total_num_tables, $sub_part, $tooltip_truename;
global $db_collation, $tooltip_aliasname, $pos, $is_information_schema, $single_table, $num_tables;
@ -115,7 +115,7 @@ class OperationsController extends AbstractController
// go back to current db, just in case
$this->dbi->selectDb($db);
$tables_full = $this->dbi->getTablesFull($db);
$tableNames = $this->dbi->getTables($db);
// remove all foreign key constraints, otherwise we can get errors
/** @var ExportSql $export_sql_plugin */
@ -125,10 +125,10 @@ class OperationsController extends AbstractController
]);
// create stand-in tables for views
$views = $this->operations->getViewsAndCreateSqlViewStandIn($tables_full, $export_sql_plugin, $db);
$views = $this->operations->getViewsAndCreateSqlViewStandIn($tableNames, $export_sql_plugin, $db);
// copy tables
$sqlConstratints = $this->operations->copyTables($tables_full, $move, $db);
$sqlConstratints = $this->operations->copyTables($tableNames, $move, $db);
// handle the views
if (! $_error) {

View File

@ -14,6 +14,7 @@ use PhpMyAdmin\Message;
use PhpMyAdmin\Operations;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Sql;
use PhpMyAdmin\Table;
use PhpMyAdmin\Template;
use PhpMyAdmin\Transformations;
use PhpMyAdmin\Util;
@ -21,6 +22,7 @@ use PhpMyAdmin\Utils\ForeignKey;
use function __;
use function count;
use function is_string;
final class EmptyTableController extends AbstractController
{
@ -82,6 +84,10 @@ final class EmptyTableController extends AbstractController
$selectedCount = count($selected);
for ($i = 0; $i < $selectedCount; $i++) {
if (! is_string($selected[$i]) || Table::get($selected[$i], $GLOBALS['db'], $this->dbi)->isView()) {
continue;
}
$aQuery = 'TRUNCATE ';
$aQuery .= Util::backquote($selected[$i]);

View File

@ -14,6 +14,7 @@ use PhpMyAdmin\Util;
use function __;
use function count;
use function is_array;
use function json_decode;
use function json_encode;
use function md5;
@ -45,13 +46,16 @@ final class FavoriteTableController extends AbstractController
$errorUrl = Util::getScriptNameForOption($cfg['DefaultTabDatabase'], 'database');
$errorUrl .= Url::getCommon(['db' => $db], '&');
if (! $this->hasDatabase() || ! $this->response->isAjax()) {
if (! $this->response->isAjax()) {
return;
}
$favoriteInstance = RecentFavoriteTable::getInstance('favorite');
if (isset($parameters['favoriteTables'])) {
$favoriteTables = json_decode($parameters['favoriteTables'], true);
if (! is_array($favoriteTables)) {
$favoriteTables = [];
}
} else {
$favoriteTables = [];
}
@ -73,6 +77,10 @@ final class FavoriteTableController extends AbstractController
return;
}
if (! $this->hasDatabase()) {
return;
}
$changes = true;
$favoriteTable = $parameters['favorite_table'] ?? '';
$alreadyFavorite = $this->checkFavoriteTable($favoriteTable);
@ -170,10 +178,8 @@ final class FavoriteTableController extends AbstractController
*/
private function checkFavoriteTable(string $currentTable): bool
{
// ensure $_SESSION['tmpval']['favoriteTables'] is initialized
RecentFavoriteTable::getInstance('favorite');
$favoriteTables = $_SESSION['tmpval']['favoriteTables'][$GLOBALS['server']] ?? [];
foreach ($favoriteTables as $value) {
$recentFavoriteTables = RecentFavoriteTable::getInstance('favorite');
foreach ($recentFavoriteTables->getTables() as $value) {
if ($value['db'] == $this->db && $value['table'] == $currentTable) {
return true;
}

View File

@ -11,8 +11,6 @@ use PhpMyAdmin\Template;
use PhpMyAdmin\Url;
use PhpMyAdmin\Util;
use function json_encode;
/**
* Handles request for real row count on database level view page.
*/
@ -70,10 +68,10 @@ final class RealRowCountController extends AbstractController
->getRealRowCountTable();
$realRowCountAll[] = [
'table' => $table['TABLE_NAME'],
'row_count' => $rowCount,
'row_count' => Util::formatNumber($rowCount, 0),
];
}
$this->response->addJSON(['real_row_count_all' => json_encode($realRowCountAll)]);
$this->response->addJSON(['real_row_count_all' => $realRowCountAll]);
}
}

View File

@ -242,6 +242,7 @@ class StructureController extends AbstractController
$hiddenFields = [];
$overallApproxRows = false;
$structureTableRows = [];
$trackedTables = Tracker::getTrackedTables($GLOBALS['db']);
foreach ($this->tables as $currentTable) {
// Get valid statistics whatever is the table type
@ -355,16 +356,13 @@ class StructureController extends AbstractController
if (! $this->dbIsSystemSchema) {
$dropQuery = sprintf(
'DROP %s %s',
$tableIsView || $currentTable['ENGINE'] == null ? 'VIEW'
: 'TABLE',
$tableIsView ? 'VIEW' : 'TABLE',
Util::backquote(
$currentTable['TABLE_NAME']
)
);
$dropMessage = sprintf(
($tableIsView || $currentTable['ENGINE'] == null
? __('View %s has been dropped.')
: __('Table %s has been dropped.')),
($tableIsView ? __('View %s has been dropped.') : __('Table %s has been dropped.')),
str_replace(
' ',
'&nbsp;',
@ -417,7 +415,7 @@ class StructureController extends AbstractController
)
)
),
'tracking_icon' => $this->getTrackingIcon($truename),
'tracking_icon' => $this->getTrackingIcon($truename, $trackedTables[$truename] ?? null),
'server_replica_status' => $replicaInfo['status'],
'table_url_params' => $tableUrlParams,
'db_is_system_schema' => $this->dbIsSystemSchema,
@ -521,20 +519,20 @@ class StructureController extends AbstractController
/**
* Returns the tracking icon if the table is tracked
*
* @param string $table table name
* @param string $table table name
* @param array|null $trackedTable
*
* @return string HTML for tracking icon
*/
protected function getTrackingIcon(string $table): string
protected function getTrackingIcon(string $table, $trackedTable): string
{
$trackingIcon = '';
if (Tracker::isActive()) {
$isTracked = Tracker::isTracked($this->db, $table);
if ($isTracked || Tracker::getVersion($this->db, $table) > 0) {
if ($trackedTable !== null) {
$trackingIcon = $this->template->render('database/structure/tracking_icon', [
'db' => $this->db,
'table' => $table,
'is_tracked' => $isTracked,
'is_tracked' => $trackedTable['active'],
]);
}
}
@ -632,10 +630,8 @@ class StructureController extends AbstractController
*/
protected function checkFavoriteTable(string $currentTable): bool
{
// ensure $_SESSION['tmpval']['favoriteTables'] is initialized
RecentFavoriteTable::getInstance('favorite');
$favoriteTables = $_SESSION['tmpval']['favoriteTables'][$GLOBALS['server']] ?? [];
foreach ($favoriteTables as $value) {
$recentFavoriteTables = RecentFavoriteTable::getInstance('favorite');
foreach ($recentFavoriteTables->getTables() as $value) {
if ($value['db'] == $this->db && $value['table'] == $currentTable) {
return true;
}
@ -721,6 +717,7 @@ class StructureController extends AbstractController
case 'InnoDB':
case 'PBMS':
case 'TokuDB':
case 'ROCKSDB':
// InnoDB table: Row count is not accurate but data and index sizes are.
// PBMS table in Drizzle: TABLE_ROWS is taken from table cache,
// so it may be unavailable

View File

@ -379,7 +379,8 @@ final class ExportController extends AbstractController
// Do we need to convert charset?
$output_charset_conversion = $asfile
&& Encoding::isSupported()
&& isset($charset) && $charset !== 'utf-8';
&& isset($charset) && $charset !== 'utf-8'
&& in_array($charset, Encoding::listEncodings(), true);
// Use on the fly compression?
$GLOBALS['onfly_compression'] = $GLOBALS['cfg']['CompressOnFly']
@ -478,7 +479,17 @@ final class ExportController extends AbstractController
// Include dates in export?
$do_dates = isset($GLOBALS[$what . '_dates']);
$whatStrucOrData = $GLOBALS[$what . '_structure_or_data'];
$whatStrucOrData = $GLOBALS[$what . '_structure_or_data'] ?? null;
if (! in_array($whatStrucOrData, ['structure', 'data', 'structure_and_data'], true)) {
$whatStrucOrData = 'data';
/** @var mixed $whatStrucOrDataDefaultValue */
$whatStrucOrDataDefaultValue = $cfg['Export'][$what . '_structure_or_data'] ?? null;
if (in_array($whatStrucOrDataDefaultValue, ['structure', 'data', 'structure_and_data'], true)) {
$whatStrucOrData = $whatStrucOrDataDefaultValue;
}
$GLOBALS[$what . '_structure_or_data'] = $whatStrucOrData;
}
if ($export_type === 'raw') {
$whatStrucOrData = 'raw';

View File

@ -15,10 +15,8 @@ use function array_merge;
use function in_array;
use function intval;
use function is_array;
use function mb_strpos;
use function mb_strtoupper;
use function mb_substr;
use function substr;
use function preg_match;
use function trim;
/**
@ -26,9 +24,19 @@ use function trim;
*/
class GisDataEditorController extends AbstractController
{
private const GIS_TYPES = [
'POINT',
'MULTIPOINT',
'LINESTRING',
'MULTILINESTRING',
'POLYGON',
'MULTIPOLYGON',
'GEOMETRYCOLLECTION',
];
public function __invoke(ServerRequest $request): void
{
global $gis_data, $gis_types, $start, $geom_type, $gis_obj, $srid, $wkt, $wkt_with_zero;
global $gis_data, $geom_type, $gis_obj, $srid, $wkt, $wkt_with_zero;
global $result, $visualizationSettings, $data, $visualization, $open_layers, $geom_count, $dbi;
/** @var string|null $field */
@ -36,7 +44,7 @@ class GisDataEditorController extends AbstractController
/** @var array|null $gisDataParam */
$gisDataParam = $request->getParsedBodyParam('gis_data');
/** @var string $type */
$type = $request->getParsedBodyParam('type', '');
$type = $request->getParsedBodyParam('type', 'GEOMETRY');
/** @var string|null $value */
$value = $request->getParsedBodyParam('value');
/** @var string|null $generate */
@ -54,33 +62,7 @@ class GisDataEditorController extends AbstractController
$gis_data = $gisDataParam;
}
$gis_types = [
'POINT',
'MULTIPOINT',
'LINESTRING',
'MULTILINESTRING',
'POLYGON',
'MULTIPOLYGON',
'GEOMETRYCOLLECTION',
];
// Extract type from the initial call and make sure that it's a valid one.
// Extract from field's values if available, if not use the column type passed.
if (! isset($gis_data['gis_type'])) {
if ($type !== '') {
$gis_data['gis_type'] = mb_strtoupper($type);
}
if (isset($value) && trim($value) !== '') {
$start = substr($value, 0, 1) == "'" ? 1 : 0;
$gis_data['gis_type'] = mb_substr($value, $start, (int) mb_strpos($value, '(') - $start);
}
if (! isset($gis_data['gis_type']) || (! in_array($gis_data['gis_type'], $gis_types))) {
$gis_data['gis_type'] = $gis_types[0];
}
}
$gis_data = $this->validateGisData($gis_data, $type, $value);
$geom_type = $gis_data['gis_type'];
// Generate parameters from value passed.
@ -150,7 +132,8 @@ class GisDataEditorController extends AbstractController
'srid' => $srid,
'visualization' => $visualization,
'open_layers' => $open_layers,
'gis_types' => $gis_types,
'column_type' => mb_strtoupper($type),
'gis_types' => self::GIS_TYPES,
'geom_type' => $geom_type,
'geom_count' => $geom_count,
'gis_data' => $gis_data,
@ -159,4 +142,32 @@ class GisDataEditorController extends AbstractController
$this->response->addJSON(['gis_editor' => $templateOutput]);
}
/**
* Extract type from the initial call and make sure that it's a valid one.
* Extract from field's values if available, if not use the column type passed.
*
* @param mixed[] $gis_data
*
* @return mixed[]
* @psalm-return array{gis_type:value-of<self::GIS_TYPES>}&mixed[]
*/
private function validateGisData(array $gis_data, string $type, ?string $value): array
{
if (! isset($gis_data['gis_type']) || ! in_array($gis_data['gis_type'], self::GIS_TYPES, true)) {
if ($type !== '') {
$gis_data['gis_type'] = mb_strtoupper($type);
}
if (isset($value) && trim($value) !== '' && preg_match('/^\'?(\w+)\b/', $value, $matches)) {
$gis_data['gis_type'] = $matches[1];
}
if (! isset($gis_data['gis_type']) || (! in_array($gis_data['gis_type'], self::GIS_TYPES, true))) {
$gis_data['gis_type'] = self::GIS_TYPES[0];
}
}
return $gis_data;
}
}

View File

@ -27,6 +27,7 @@ use function count;
use function extension_loaded;
use function file_exists;
use function ini_get;
use function is_string;
use function mb_strlen;
use function preg_match;
use function sprintf;
@ -107,9 +108,13 @@ class HomeController extends AbstractController
$hasServer = $server > 0 || count($cfg['Servers']) > 1;
if ($hasServer) {
$hasServerSelection = $cfg['ServerDefault'] == 0
|| (! $cfg['NavigationDisplayServers']
&& (count($cfg['Servers']) > 1
|| ($server == 0 && count($cfg['Servers']) === 1)));
|| (
$cfg['NavigationDisplayServers']
&& (
count($cfg['Servers']) > 1
|| ($server == 0 && count($cfg['Servers']) === 1)
)
);
if ($hasServerSelection) {
$serverSelection = Select::render(true, true);
}
@ -188,7 +193,7 @@ class HomeController extends AbstractController
}
$relation = new Relation($this->dbi);
if ($server > 0) {
if ($server > 0 && $relation->arePmadbTablesAllDisabled() === false) {
$relationParameters = $relation->getRelationParameters();
if (! $relationParameters->hasAllFeatures() && $cfg['PmaNoRelation_DisableWarning'] == false) {
$messageText = __(
@ -311,7 +316,12 @@ class HomeController extends AbstractController
* Check if user does not have defined blowfish secret and it is being used.
*/
if (! empty($_SESSION['encryption_key'])) {
$encryptionKeyLength = mb_strlen($cfg['blowfish_secret'], '8bit');
$encryptionKeyLength = 0;
// This can happen if the user did use getenv() to set blowfish_secret
if (is_string($cfg['blowfish_secret'])) {
$encryptionKeyLength = mb_strlen($cfg['blowfish_secret'], '8bit');
}
if ($encryptionKeyLength < SODIUM_CRYPTO_SECRETBOX_KEYBYTES) {
$this->errors[] = [
'message' => __(

View File

@ -530,7 +530,7 @@ final class ImportController extends AbstractController
// Convert the file's charset if necessary
if (Encoding::isSupported() && isset($charset_of_file)) {
if ($charset_of_file !== 'utf-8') {
if ($charset_of_file !== 'utf-8' && in_array($charset_of_file, Encoding::listEncodings(), true)) {
$charset_conversion = true;
}
} elseif (isset($charset_of_file) && $charset_of_file !== 'utf-8') {

View File

@ -8,21 +8,37 @@ use PhpMyAdmin\Controllers\AbstractController;
use PhpMyAdmin\Import\SimulateDml;
use PhpMyAdmin\Message;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\SqlParser\Lexer;
use PhpMyAdmin\SqlParser\Parser;
use PhpMyAdmin\SqlParser\Statements\DeleteStatement;
use PhpMyAdmin\SqlParser\Statements\UpdateStatement;
use PhpMyAdmin\SqlParser\Token;
use PhpMyAdmin\SqlParser\TokensList;
use PhpMyAdmin\SqlParser\Utils\Query;
use PhpMyAdmin\Template;
use function __;
use function array_filter;
use function array_values;
use function count;
use function explode;
final class SimulateDmlController extends AbstractController
{
/** @var SimulateDml */
private $simulateDml;
/** @var string */
private $error = '';
/**
* @var list<array<mixed>>
* @psalm-var list<array{
* sql_query: string,
* matched_rows: int,
* matched_rows_url: string,
* }>
*/
private $data = [];
public function __construct(
ResponseRenderer $response,
Template $template,
@ -34,60 +50,56 @@ final class SimulateDmlController extends AbstractController
public function __invoke(): void
{
$error = '';
$errorMsg = __('Only single-table UPDATE and DELETE queries can be simulated.');
/** @var string $sqlDelimiter */
$sqlDelimiter = $_POST['sql_delimiter'];
$sqlData = [];
/** @var string[] $queries */
$queries = explode($sqlDelimiter, $GLOBALS['sql_query']);
foreach ($queries as $sqlQuery) {
if (empty($sqlQuery)) {
continue;
}
// Parsing the query.
$parser = new Parser($sqlQuery);
$parser = $this->createParser($GLOBALS['sql_query'], $sqlDelimiter);
$this->process($parser);
if (empty($parser->statements[0])) {
continue;
}
$statement = $parser->statements[0];
if (
! ($statement instanceof UpdateStatement || $statement instanceof DeleteStatement)
|| ! empty($statement->join)
) {
$error = $errorMsg;
break;
}
$tables = Query::getTables($statement);
if (count($tables) > 1) {
$error = $errorMsg;
break;
}
// Get the matched rows for the query.
$result = $this->simulateDml->getMatchedRows($sqlQuery, $parser, $statement);
$error = $this->simulateDml->getError();
if ($error !== '') {
break;
}
$sqlData[] = $result;
}
if ($error) {
$message = Message::rawError($error);
$this->response->addJSON('message', $message);
if ($this->error) {
$this->response->addJSON('message', Message::rawError($this->error));
$this->response->addJSON('sql_data', false);
return;
}
$this->response->addJSON('sql_data', $sqlData);
$this->response->addJSON('sql_data', $this->data);
}
private function createParser(string $query, string $delimiter): Parser
{
$lexer = new Lexer($query, false, $delimiter);
$list = new TokensList(array_values(array_filter(
$lexer->list->tokens,
static function ($token): bool {
return $token->type !== Token::TYPE_COMMENT;
}
)));
return new Parser($list);
}
private function process(Parser $parser): void
{
foreach ($parser->statements as $statement) {
if (
! $statement instanceof UpdateStatement && ! $statement instanceof DeleteStatement
|| ! empty($statement->join)
|| count(Query::getTables($statement)) > 1
) {
$this->error = __('Only single-table UPDATE and DELETE queries can be simulated.');
break;
}
// Get the matched rows for the query.
$result = $this->simulateDml->getMatchedRows($parser, $statement);
$this->error = $this->simulateDml->getError();
if ($this->error !== '') {
break;
}
$this->data[] = $result;
}
}
}

View File

@ -40,7 +40,7 @@ final class JavaScriptMessagesController
'strDoYouReally' => __('Do you really want to execute "%s"?'),
'strDropDatabaseStrongWarning' => __('You are about to DESTROY a complete database!'),
'strDatabaseRenameToSameName' => __(
'Cannot rename database to the same name. Change the name and try again'
'Cannot rename database to the same name. Change the name and try again.'
),
'strDropTableStrongWarning' => __('You are about to DESTROY a complete table!'),
'strTruncateTableStrongWarning' => __('You are about to TRUNCATE a complete table!'),
@ -118,7 +118,6 @@ final class JavaScriptMessagesController
/* For Simulate DML*/
'strSimulateDML' => __('Simulate query'),
'strMatchedRows' => __('Matched rows:'),
'strSQLQuery' => __('SQL query:'),
/* Charts */
@ -386,6 +385,7 @@ final class JavaScriptMessagesController
'strHideQueryBox' => __('Hide query box'),
'strShowQueryBox' => __('Show query box'),
'strEdit' => __('Edit'),
'strEditQuery' => __('Edit query'),
'strDelete' => __('Delete'),
'strNotValidRowNumber' => __('%d is not valid row number.'),
'strBrowseForeignValues' => __('Browse foreign values'),
@ -473,6 +473,7 @@ final class JavaScriptMessagesController
/* For table/change.js */
'strIgnore' => __('Ignore'),
'strCopyToClipboard' => __('Copy to clipboard'),
'strCopy' => __('Copy'),
'strX' => __('X'),
'strY' => __('Y'),
@ -609,6 +610,7 @@ final class JavaScriptMessagesController
/* l10n: Latest available phpMyAdmin version */
'strLatestAvailable' => __(', latest stable version:'),
'strUpToDate' => __('up to date'),
'errorLoadingGitInformation' => __('There was an error in loading the Git information.'),
/* Error Reporting */
'strErrorOccurred' => __('A fatal JavaScript error has occurred. Would you like to send an error report?'),

View File

@ -10,6 +10,8 @@ namespace PhpMyAdmin\Controllers;
use PhpMyAdmin\Core;
use PhpMyAdmin\Linter;
use function is_array;
use function is_string;
use function json_encode;
/**
@ -17,45 +19,48 @@ use function json_encode;
*/
class LintController extends AbstractController
{
public const EDITOR_SQL_PREFIX = [
'event' => "DELIMITER $$ CREATE EVENT `a` ON SCHEDULE EVERY MINUTE DO\n",
'routine' => "DELIMITER $$ CREATE PROCEDURE `a`()\n",
'trigger' => "DELIMITER $$ CREATE TRIGGER `a` AFTER INSERT ON `b` FOR EACH ROW\n",
];
public function __invoke(): void
{
$params = [
'sql_query' => $_POST['sql_query'] ?? null,
'options' => $_POST['options'] ?? null,
];
$sqlQueryParam = $_POST['sql_query'] ?? null;
$options = $_POST['options'] ?? null;
/**
* The SQL query to be analyzed.
*
* This does not need to be checked again XSS or MySQL injections because it is
* This does not need to be checked against XSS or MySQL injections because it is
* never executed, just parsed.
*
* The client, which will receive the JSON response will decode the message and
* and any HTML fragments that are displayed to the user will be encoded anyway.
*
* @var string
*/
$sqlQuery = ! empty($params['sql_query']) ? $params['sql_query'] : '';
$sqlQuery = is_string($sqlQueryParam) ? $sqlQueryParam : '';
$this->response->setAjax(true);
$editorType = is_array($options) ? ($options['editorType'] ?? null) : null;
$prefix = is_string($editorType) ? self::EDITOR_SQL_PREFIX[$editorType] ?? '' : '';
// Disabling standard response.
$this->response->disable();
$lints = Linter::lint($prefix . $sqlQuery);
if ($prefix !== '') {
// Adjust positions to account for prefix
foreach ($lints as $i => $lint) {
if ($lint['fromLine'] === 0) {
continue;
}
Core::headerJSON();
if (! empty($params['options'])) {
$options = $params['options'];
if (! empty($options['routineEditor'])) {
$sqlQuery = 'CREATE PROCEDURE `a`() ' . $sqlQuery;
} elseif (! empty($options['triggerEditor'])) {
$sqlQuery = 'CREATE TRIGGER `a` AFTER INSERT ON `b` FOR EACH ROW ' . $sqlQuery;
} elseif (! empty($options['eventEditor'])) {
$sqlQuery = 'CREATE EVENT `a` ON SCHEDULE EVERY MINUTE DO ' . $sqlQuery;
$lints[$i]['fromLine'] -= 1;
$lints[$i]['toLine'] -= 1;
}
}
echo json_encode(Linter::lint($sqlQuery));
$this->response->setAjax(true);
// Disabling standard response.
$this->response->disable();
Core::headerJSON();
echo json_encode($lints);
}
}

View File

@ -237,7 +237,6 @@ class ManageController extends AbstractController
$result = $this->userPreferences->save([]);
if ($result === true) {
$params = [];
$this->config->removeCookie('pma_collaction_connection');
$this->config->removeCookie('pma_lang');
$this->userPreferences->redirect('index.php?route=/preferences/manage', $params);

View File

@ -13,6 +13,7 @@ use PhpMyAdmin\TwoFactor;
use function __;
use function count;
use function define;
class TwoFactorController extends AbstractController
{
@ -73,5 +74,11 @@ class TwoFactorController extends AbstractController
'backends' => $twoFactor->getAllBackends(),
'missing' => $twoFactor->getMissingDeps(),
]);
if ($this->response->isAjax()) {
$this->response->addJSON('disableNaviSettings', true);
} else {
define('PMA_DISABLE_NAVI_SETTINGS', true);
}
}
}

View File

@ -35,10 +35,7 @@ class BinlogController extends AbstractController
parent::__construct($response, $template);
$this->dbi = $dbi;
$this->binaryLogs = $this->dbi->fetchResult(
'SHOW MASTER LOGS',
'Log_name'
);
$this->binaryLogs = $this->dbi->fetchResult('SHOW BINARY LOGS', 'Log_name');
}
public function __invoke(): void

View File

@ -8,6 +8,7 @@ use PhpMyAdmin\ConfigStorage\RelationCleanup;
use PhpMyAdmin\Controllers\AbstractController;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Message;
use PhpMyAdmin\Query\Utilities;
use PhpMyAdmin\ResponseRenderer;
use PhpMyAdmin\Template;
use PhpMyAdmin\Transformations;
@ -16,8 +17,10 @@ use PhpMyAdmin\Util;
use function __;
use function _ngettext;
use function array_filter;
use function count;
use function is_array;
use function is_string;
final class DestroyController extends AbstractController
{
@ -47,8 +50,6 @@ final class DestroyController extends AbstractController
{
global $selected, $errorUrl, $cfg, $dblist, $reload;
$selected_dbs = $_POST['selected_dbs'] ?? null;
if (
! $this->response->isAjax()
|| (! $this->dbi->isSuperUser() && ! $cfg['AllowUserDropDatabase'])
@ -61,10 +62,14 @@ final class DestroyController extends AbstractController
return;
}
if (
! is_array($selected_dbs)
|| $selected_dbs === []
) {
$selected_dbs = isset($_POST['selected_dbs']) && is_array($_POST['selected_dbs']) ? $_POST['selected_dbs'] : [];
$selected_dbs = array_filter($selected_dbs, static function ($database): bool {
return is_string($database)
&& ! Utilities::isSystemSchema($database, true)
&& $database !== ($GLOBALS['cfg']['Server']['pmadb'] ?? '');
});
if ($selected_dbs === []) {
$message = Message::error(__('No databases selected.'));
$json = ['message' => $message];
$this->response->setRequestStatus($message->isSuccess());

View File

@ -234,8 +234,9 @@ class PrivilegesController extends AbstractController
*/
if (! empty($_POST['update_privs'])) {
if (is_array($dbname)) {
$statements = [];
foreach ($dbname as $key => $db_name) {
[$sql_query[$key], $message] = $serverPrivileges->updatePrivileges(
[$statements[$key], $message] = $serverPrivileges->updatePrivileges(
($username ?? ''),
($hostname ?? ''),
($tablename ?? ($routinename ?? '')),
@ -244,7 +245,7 @@ class PrivilegesController extends AbstractController
);
}
$sql_query = implode("\n", $sql_query);
$sql_query = implode("\n", $statements);
} else {
[$sql_query, $message] = $serverPrivileges->updatePrivileges(
($username ?? ''),

View File

@ -11,9 +11,7 @@ use PhpMyAdmin\Sql;
use PhpMyAdmin\Template;
use function __;
use function htmlentities;
use const ENT_COMPAT;
use function strval;
final class EnumValuesController extends AbstractController
{
@ -44,7 +42,7 @@ final class EnumValuesController extends AbstractController
$this->checkUserPrivileges->getPrivileges();
$column = $_POST['column'];
$curr_value = $_POST['curr_value'];
$currValue = $_POST['curr_value'];
$values = $this->sql->getValuesForColumn($db, $table, $column);
if ($values === null) {
@ -54,12 +52,9 @@ final class EnumValuesController extends AbstractController
return;
}
// Converts characters of $curr_value to HTML entities.
$convertedCurrentValue = htmlentities($curr_value, ENT_COMPAT, 'UTF-8');
$dropdown = $this->template->render('sql/enum_column_dropdown', [
'values' => $values,
'selected_values' => [$convertedCurrentValue],
'selected_values' => [strval($currValue)],
]);
$this->response->addJSON('dropdown', $dropdown);

View File

@ -11,9 +11,7 @@ use PhpMyAdmin\Sql;
use PhpMyAdmin\Template;
use function __;
use function htmlentities;
use const ENT_COMPAT;
use function explode;
final class SetValuesController extends AbstractController
{
@ -62,12 +60,9 @@ final class SetValuesController extends AbstractController
$currentValue = $this->sql->getFullValuesForSetColumn($db, $table, $column, $whereClause);
}
// Converts characters of $currentValue to HTML entities.
$convertedCurrentValue = htmlentities($currentValue, ENT_COMPAT, 'UTF-8');
$select = $this->template->render('sql/set_column', [
'values' => $values,
'current_values' => $convertedCurrentValue,
'current_values' => explode(',', $currentValue),
]);
$this->response->addJSON('select', $select);

View File

@ -6,6 +6,7 @@ namespace PhpMyAdmin\Controllers\Table;
use PhpMyAdmin\Config\PageSettings;
use PhpMyAdmin\ConfigStorage\Relation;
use PhpMyAdmin\Core;
use PhpMyAdmin\DbTableExists;
use PhpMyAdmin\Html\Generator;
use PhpMyAdmin\InsertEdit;
@ -60,6 +61,12 @@ class ChangeController extends AbstractController
DbTableExists::check();
if (isset($_GET['where_clause'], $_GET['where_clause_signature'])) {
if (Core::checkSqlQuerySignature($_GET['where_clause'], $_GET['where_clause_signature'])) {
$where_clause = $_GET['where_clause'];
}
}
/**
* Determine whether Insert or Edit and set global variables
*/

View File

@ -53,7 +53,9 @@ final class IndexRenameController extends AbstractController
if (isset($_POST['index'])) {
if (is_array($_POST['index'])) {
// coming already from form
$index = new Index($_POST['index']);
$oldIndex = is_array($_POST['old_index']) ? $_POST['old_index']['Key_name'] : $_POST['old_index'];
$index = clone $this->dbi->getTable($this->db, $this->table)->getIndex($oldIndex);
$index->setName($_POST['index']['Key_name']);
} else {
$index = $this->dbi->getTable($this->db, $this->table)->getIndex($_POST['index']);
}

View File

@ -134,12 +134,12 @@ final class RelationController extends AbstractController
$column_hash_array = [];
$column_array[''] = '';
foreach ($columns as $column) {
$column_hash_array[$column['Field']] = md5($column['Field']);
if (strtoupper($storageEngine) !== 'INNODB' && empty($column['Key'])) {
continue;
}
$column_array[$column['Field']] = $column['Field'];
$column_hash_array[$column['Field']] = md5($column['Field']);
}
if ($GLOBALS['cfg']['NaturalOrder']) {

View File

@ -379,7 +379,7 @@ final class ReplaceController extends AbstractController
$value_sets[] = implode(', ', $query_values);
} else {
// build update query
$clauseIsUnique = $_POST['clause_is_unique'] ?? '';// Should contain 0 or 1
$clauseIsUnique = $_POST['clause_is_unique'] ?? $_GET['clause_is_unique'] ?? '';// Should contain 0 or 1
$query[] = 'UPDATE ' . Util::backquote($table)
. ' SET ' . implode(', ', $query_values)
. ' WHERE ' . $where_clause

Some files were not shown because too many files have changed in this diff Show More