Skip to content
Snippets Groups Projects
Commit efb943fa authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #693 from greezybacon/issue/670


Make phone ext optional for XML API

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 6d351d83 aca7aba9
No related branches found
No related tags found
No related merge requests found
......@@ -317,8 +317,9 @@ class ApiXmlDataParser extends XmlDataParser {
if (!is_array($current))
return $current;
foreach ($current as $key=>&$value) {
if ($key == "phone") {
$current["phone_ext"] = $value["ext"]; # PHP [like] point
if ($key == "phone" && is_array($value)) {
if (isset($value['ext']))
$current["phone_ext"] = $value["ext"]; # PHP [like] point
$value = $value[":text"];
} else if ($key == "alert") {
$value = (bool)$value;
......@@ -339,6 +340,7 @@ class ApiXmlDataParser extends XmlDataParser {
$value = $this->fixup($value);
}
}
unset($value);
return $current;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment