Download & Extend

_phptemplate_default doesn't check that parameters passed in by declarations in template.php are arrays

Project:PHPTemplate
Version:master
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:active

Issue Summary

Declare the following in template.php

phptemplate_hooktotheme() {
_phptemplate_callback('my_tplfile', $vars, 'suggested_tpl');
}

You'll receive a host of php warnings regarding foreach() receiving a non-array. While it should be standard practice for template coders to pass in arrays when they should and pass in variables when they should, perhaps relying on that may not be the most desirable thing. A sanity check to make sure that values passed in are what you expect them to be would be ideal -- something as simple as a cast into array within _phptemplate_callback() or checking with is_array() before handling might do the trick.

nobody click here