Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't blow up when handling an object or an array

  • Loading branch information...
commit 20302648ad74ecb4fe6954f4739cf787eb42b376 1 parent 9c8015e
@steveh authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 Services/Hoptoad.php
View
11 Services/Hoptoad.php
@@ -219,7 +219,7 @@ function buildXmlNotice()
$this->addXmlBacktrace($error);
$request = $doc->addChild('request');
- $request->addChild('url', $this->request_uri());
+ $request->addChild('url', htmlentities($this->request_uri()));
$request->addChild('component', $this->component());
$request->addChild('action', $this->action());
@@ -245,7 +245,14 @@ function addXmlVars($parent, $key, $source)
$node = $parent->addChild($key);
foreach ($source as $key => $val) {
- $var_node = $node->addChild('var', $val);
+ if (is_array($key) || is_object($key)) {
+ $key = str_replace("\n", ' ', print_r($key, true));
+ }
+ if (is_array($val) || is_object($val)) {
+ $val = str_replace("\n", ' ', print_r($val, true));
+ }
+
+ $var_node = $node->addChild('var', htmlentities($val));
$var_node->addAttribute('key', $key);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.