Prohibit access to get_instance() from a view |
-
rolf
Junior Member
-
Posts: 12
Threads: 4
Joined: Dec 2015
Reputation:
0
(11-21-2017, 01:12 PM)ivantcholakov Wrote: There are things to be considered: get_instace() might be used within (custom or not) helper functions that are to be used within a view. Also, some people use HMVC.
If somehow you trace the stack, then you will need to find the actual file, then check whether it is under a folder named 'views', or a subfolder of 'views' and then block get_instance() on such a condition. Such a detection (if possible) would be tricky, unreliable and slow.
Better stick to Twig since you adopted it and know how to use it. It has enabled by default html escaping, this is even more important than the problem you have pointed.
In production systems enable the caching feature of Twig (cached files contain PHP code, actually). I observed that caching reduced memory consumption a lot. See the attached picture.
Hi ivantcholakov, thanks for taking the time to reply
|
Messages In This Thread |
RE: Prohibit access to get_instance() from a view - by rolf - 11-22-2017, 05:35 AM
|