Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of deprecated String.prototype.substr() #17372

Merged
merged 1 commit into from
Feb 13, 2022
Merged

Remove usage of deprecated String.prototype.substr() #17372

merged 1 commit into from
Feb 13, 2022

Conversation

CommanderRoot
Copy link
Contributor

String.prototype.substr() is deprecated (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we either switch to String.prototype.substring() or something else appropriate for the use case
Signed-off-by: Tobias Speicher rootcommander@gmail.com

Description

This commit remove all usage of .substr() in the codebase (except in the vendored js files). The calls to substr() are either replaced with substring() which is a near replacement in most cases or other functions which are designed to be used in these use cases.

Fixes #
Removes deprecation warnings due to usage of .substr()

Before submitting pull request, please review the following checklist:

  • Make sure you have read our CONTRIBUTING.md document.
  • Make sure you are making a pull request against the correct branch. For example, for bug fixes in a released version use the corresponding QA branch and for new features use the master branch. If you have a doubt, you can ask as a comment in the bug report or on the mailing list.
  • Every commit has proper Signed-off-by line as described in our DCO. This ensures that the work you're submitting is your own creation.
  • Every commit has a descriptive commit message.
  • Every commit is needed on its own, if you have just minor fixes to previous commits, you can squash them.
  • Any new functionality is covered by tests.

String.prototype.substr() is deprecated (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we either switch to String.prototype.substring() or something else appropriate for the use case
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #17372 (44b528f) into master (25e00f3) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #17372      +/-   ##
============================================
- Coverage     49.37%   49.34%   -0.03%     
  Complexity    16666    16666              
============================================
  Files           601      601              
  Lines         59695    59695              
============================================
- Hits          29475    29458      -17     
- Misses        30220    30237      +17     
Flag Coverage Δ
dbase-extension 47.98% <ø> (+0.08%) ⬆️
recode-extension 47.89% <ø> (-1.21%) ⬇️
unit-7.2-ubuntu-latest 47.90% <ø> (-0.02%) ⬇️
unit-7.3-ubuntu-latest 50.45% <ø> (-0.62%) ⬇️
unit-7.4-ubuntu-latest 50.41% <ø> (-1.35%) ⬇️
unit-8.0-ubuntu-latest 51.78% <ø> (+1.25%) ⬆️
unit-8.1-ubuntu-latest 50.64% <ø> (-1.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ries/classes/Plugins/Auth/AuthenticationConfig.php 70.14% <0.00%> (-5.98%) ⬇️
libraries/classes/StorageEngine.php 64.67% <0.00%> (-4.98%) ⬇️
libraries/classes/Gis/GisMultiLineString.php 84.75% <0.00%> (-1.22%) ⬇️
libraries/classes/Header.php 87.31% <0.00%> (-1.09%) ⬇️
libraries/classes/Gis/GisPolygon.php 78.63% <0.00%> (+0.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25e00f3...44b528f. Read the comment docs.

@williamdes williamdes added this to the 5.3.0 milestone Feb 11, 2022
@MauricioFauth MauricioFauth merged commit 835b9b3 into phpmyadmin:master Feb 13, 2022
@MauricioFauth MauricioFauth self-assigned this Feb 13, 2022
@CommanderRoot CommanderRoot deleted the remove-deprecated-js-substr branch February 13, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants