Welcome Guest, Not a member yet? Register   Sign In
Prohibit access to get_instance() from a view
#14

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.

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
RE: Prohibit access to get_instance() from a view - by ivantcholakov - 11-21-2017, 01:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB