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

25 lines
800 B
Plaintext
Raw Normal View History

/**
2023-10-04 18:28:29 +00:00
* Get a field value from the XML stored string
*
2023-10-04 18:28:29 +00:00
* @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
*
2023-10-04 18:28:29 +00:00
* @return string The field value from xml
* @since 3.2.0
*/
2023-10-04 18:28:29 +00:00
public static function getValue(&$xml, string &$get, string $confirmation = ''): string
{
2023-10-04 18:28:29 +00:00
if (StringHelper::check($xml))
{
2023-10-04 18:28:29 +00:00
// 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);
}
2023-10-04 18:28:29 +00:00
return $confirmation;
}