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