Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Commit 57dc160

Browse files
committed
✨ add _evaluated() function
Signed-off-by: otengkwame <[email protected]>
1 parent f5114d1 commit 57dc160

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

framework/core/Common.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,32 @@ function html_escape($var, $double_encode = true)
822822

823823
// ------------------------------------------------------------------------
824824

825+
if ( ! function_exists('_evaluated'))
826+
{
827+
/**
828+
* Verify if eval()'d code is contained in a string
829+
* This feels unhealthy since eval() is seen as evil
830+
*
831+
* It is used to render view files that are handled
832+
* by the Plates template engine
833+
*
834+
* @param string $string
835+
* @param string $evalError
836+
* @return bool
837+
*/
838+
function _evaluated($string, $evalError = "eval()'d code")
839+
{
840+
if (strpos($string, $evalError) !== false) {
841+
return true;
842+
}
843+
844+
return false;
845+
}
846+
847+
}
848+
849+
// ------------------------------------------------------------------------
850+
825851
if ( ! function_exists('_stringify_attributes'))
826852
{
827853
/**

0 commit comments

Comments
 (0)