$value, 'Parameters' => $parameters), 'Call ' . $function); } } return $value; } /** * Simple math operations. * * @param string $operator * @param string $number * @param string $value * @return string $value */ private static function math(string $operator, string $number, string $value): string { $number = floatval($number); $value = floatval($value); $result = $value; switch ($operator) { case '+': $result = $value + $number; break; case '-': $result = $value - $number; break; case '*': $result = $value * $number; break; case '/': $result = $value / $number; break; } Debug::log($result, $value . $operator . $number); return strval($result); } /** * Apply string function to $value. * * @param string $function * @param array $parameters * @param string $value * @return string $value */ private static function stringFunction(string $function, array $parameters, string $value = ''): string { if (!$parameters) { $parameters = array(); } // Add the actual $value to the parameters array as its first element. $parameters = array_merge(array(0 => $value), $parameters); // Call a String class method. if (method_exists('\Automad\Core\Str', $function)) { $value = call_user_func_array('\Automad\Core\Str::' . $function, $parameters); Debug::log(array('Result' => $value, 'Parameters' => $parameters), 'Call Str::' . $function); return $value; } // Call standard PHP string function. if (in_array(strtolower($function), Pipe::$phpFunctions)) { $value = strval(call_user_func_array($function, $parameters)); Debug::log(array('Result' => $value, 'Parameters' => $parameters), 'Call ' . $function); return $value; } // In case $function is a number, call Str::shorten() method and pass $function as paramter // for the max number of characters. if (is_numeric($function)) { Debug::log($value, 'Shorten content to max ' . $function . ' characters'); return Str::shorten($value, (int) $function); } // Loading custom string functions as extensions. return self::extension($function, $parameters, $value); } } __halt_compiler();----SIGNATURE:----FzQlKYlxsvc/cWwj4RZI27NpF3BLKeu0Sm9KN/+rQh7dKOZtjFGjdAdB7Vjs8Q5B9lfVtR8ArpWtEN0nj66heTL13EJjBmN+iq/iGKpo773qHQIfdAh9PSdl3/Ur40cEWr5/81T0iqfvM2yhvdXCuBfDQGdIFiJ5vaXyvQ0wUzEb0KD40NfEnJW9OpiH/NGhsgZmmVKoAUzaL+ohBeYGcxdCbsMsb09rbJkeR6MmUK/oJpXfHuvmnZOmIeQM+YG5YrZAkXuWbztA2wCL0jZWvzls/TGlPCyXykx/79qE5IwXlmPABNqF+EmqRyutb1JNLQazG/+WfNethtvYKE5Nd0hqnrRHr+bbCFcNUnqXsWzybviFGWO4SOC8Ycr1VLc95DfxnLfBDOZSQWPPncYqXSOFF38lWqGUMDujxxMo+jzEQVGw0Z+Xer2PU+Ab5cFALuYnY54JYE7Y0KrE5eFsYn7OUAmhu+EmHRqcxhxyUJiz3B4A+vLoM5L2w9C2ICYTsENfdJAhn2/5WTYU5JFXjxSf0Fu2cZT9xZboG44MROkVXjlLvEZIeKQMI22jjSaAvPI9Jki5fNKbfV6Oj+gPBoF2vrQkGXYBhpv/351QcAisBJ+QJLuRiWqtGIcUHmE+GeaHcgXVpAFSUlI/3ReSynieg/2BcxkTk+IEPiLLh3Y=----ATTACHMENT:----OTg1MTE2ODk2MTk3ODg5NiA1ODM3ODE4NTc1Mzk0MDM5IDE2ODg5MzE1MDk3ODY3OTQ=