jcb-compiler/src/7a5fd3f3-199e-43ba-a8e8-f47.../code.power

25 lines
800 B
Plaintext

/**
* Get a field value from the XML stored string
*
* @param string $xml The xml string of the field
* @param string $get The value key to get from the string
* @param string $confirmation The value to confirm found value
*
* @return string The field value from xml
* @since 3.2.0
*/
public static function getValue(&$xml, string &$get, string $confirmation = ''): string
{
if (StringHelper::check($xml))
{
// if we have a PHP value, we must base64 decode it
if (strpos($get, 'type_php') !== false)
{
return Base64Helper::open(GetHelper::between($xml, $get . '="', '"', $confirmation));
}
return GetHelper::between($xml, $get . '="', '"', $confirmation);
}
return $confirmation;
}