Repository navigation
fix(template): register sprintf as a Smarty modifier - #264
Conversation
Smarty 4 deprecates PHP functions used as modifiers unless they are registered. XoopsTpl already registers strstr, trim and file_exists; add sprintf so module templates using |sprintf render without a deprecation notice.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRegisters sprintf as an explicit Smarty modifier in XoopsTpl, preventing Smarty 4 deprecation notices for templates that use the |sprintf filter, with a corresponding changelog entry. Sequence diagram for registered sprintf template modifiersequenceDiagram
participant Template as XoopsTpl
participant Smarty
participant TemplateFile
Template->>Smarty: registerPlugin(modifier, sprintf, sprintf)
TemplateFile->>Smarty: render template with |sprintf
Smarty->>Smarty: sprintf()
Smarty-->>TemplateFile: rendered output without deprecation notice
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
🟢 Approval recommended
The registration is valid, narrowly scoped, and documented correctly.
0 open findings
What changed in this PR
Registers sprintf as a Smarty modifier to prevent Smarty 4 deprecation notices.
Changes:
- Registers the native
sprintfmodifier inXoopsTpl. - Documents the compatibility fix.
| File | Description |
|---|---|
htdocs/class/template.php |
Registers the sprintf modifier. |
docs/changelog.270.txt |
Records the template compatibility fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #264 +/- ##
============================================
- Coverage 22.54% 22.54% -0.01%
Complexity 8666 8666
============================================
Files 685 685
Lines 46315 46316 +1
============================================
Hits 10444 10444
- Misses 35871 35872 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Smarty 4 deprecates PHP functions used as modifiers unless they are registered. XoopsTpl already registers strstr, trim and file_exists; add sprintf so module templates using |sprintf render without a deprecation notice.
Summary by Sourcery
Register
sprintfas a Smarty modifier for compatibility with Smarty 4 template rendering.Bug Fixes:
sprintfPHP function as a Smarty modifier to prevent deprecation notices when rendering module templates with|sprintf.Documentation: