Skip to content

Enable Twig's strict_variables option in dev env#17029

Merged
MauricioFauth merged 1 commit intophpmyadmin:masterfrom
MauricioFauth:twig-strict-variables
Jul 6, 2023
Merged

Enable Twig's strict_variables option in dev env#17029
MauricioFauth merged 1 commit intophpmyadmin:masterfrom
MauricioFauth:twig-strict-variables

Conversation

@MauricioFauth
Copy link
Copy Markdown
Member

strict_variables boolean

If set to false, Twig will silently ignore invalid variables (variables and or attributes/methods that do not exist) and replace them with a null value. When set to true, Twig throws an exception instead (default to false).

https://twig.symfony.com/doc/3.x/api.html#environment-options

Also removes the $cfg['environment'] === 'production' condition as it is unnecessary.

@williamdes williamdes added this to the 5.2.0 milestone Jul 22, 2021
@MauricioFauth MauricioFauth removed this from the 5.2.0 milestone Jan 28, 2022
@williamdes williamdes marked this pull request as draft May 12, 2022 18:07
@MauricioFauth MauricioFauth force-pushed the twig-strict-variables branch 2 times, most recently from 1427a48 to 45bff8d Compare March 19, 2023 22:25
@MauricioFauth MauricioFauth marked this pull request as ready for review March 19, 2023 22:26
@MauricioFauth MauricioFauth added this to the 6.0.0 milestone Mar 19, 2023
@MauricioFauth MauricioFauth marked this pull request as draft March 19, 2023 23:05
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
@MauricioFauth MauricioFauth force-pushed the twig-strict-variables branch from 45bff8d to 71493cb Compare July 6, 2023 01:53
@MauricioFauth MauricioFauth marked this pull request as ready for review July 6, 2023 01:53
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 6, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (ba98386) 56.44% compared to head (71493cb) 56.44%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #17029   +/-   ##
=========================================
  Coverage     56.44%   56.44%           
  Complexity    16074    16074           
=========================================
  Files           635      635           
  Lines         63446    63448    +2     
=========================================
+ Hits          35813    35815    +2     
  Misses        27633    27633           
Flag Coverage Δ
dbase-extension 56.44% <100.00%> (+<0.01%) ⬆️
recode-extension 56.41% <100.00%> (+<0.01%) ⬆️
unit-8.1-ubuntu-latest 56.41% <100.00%> (+<0.01%) ⬆️
unit-8.2-ubuntu-latest 56.41% <100.00%> (+<0.01%) ⬆️
unit-nightly-ubuntu-latest 56.41% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
libraries/classes/Template.php 81.25% <100.00%> (+0.81%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@MauricioFauth MauricioFauth merged commit 0b30584 into phpmyadmin:master Jul 6, 2023
@MauricioFauth MauricioFauth deleted the twig-strict-variables branch July 6, 2023 03:36
@MauricioFauth MauricioFauth self-assigned this Jul 6, 2023
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.

2 participants