Skip to content

Fix: incorrect strpos check in triggerTagNoCache #1182

Open
zigzagdev wants to merge 1 commit intosmarty-php:masterfrom
zigzagdev:fix/strpos-pattern
Open

Fix: incorrect strpos check in triggerTagNoCache #1182
zigzagdev wants to merge 1 commit intosmarty-php:masterfrom
zigzagdev:fix/strpos-pattern

Conversation

@zigzagdev
Copy link
Copy Markdown

Description

Summary

triggerTagNoCache() uses !strpos($variable, '(') to check if ( is absent
from $variable. However, strpos returns 0 when ( appears at position 0,
and !0 evaluates to true, incorrectly skipping the nocache flag logic.

This replaces !strpos(...) with strpos(...) === false.

References

Using `!strpos(...)` incorrectly evaluates to true when `(` is at
position 0, causing the nocache flag logic to be skipped. Replace
with `strpos(...) === false` for correct behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant