Use strpos to check that @ is the first char
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
parent
7af3bcb4bc
commit
96d1640a37
|
@ -126,7 +126,7 @@ abstract class BaseResponse extends Response {
|
||||||
*/
|
*/
|
||||||
protected function toXML(array $array, \XMLWriter $writer) {
|
protected function toXML(array $array, \XMLWriter $writer) {
|
||||||
foreach ($array as $k => $v) {
|
foreach ($array as $k => $v) {
|
||||||
if ($k[0] === '@') {
|
if (\is_string($k) && strpos($k, '@') === 0) {
|
||||||
$writer->writeAttribute(substr($k, 1), $v);
|
$writer->writeAttribute(substr($k, 1), $v);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue