From 92f884eb6c62f641db12c6754a010b0512159ca8 Mon Sep 17 00:00:00 2001 From: Jason Clemons Date: Sat, 13 Jul 2013 11:48:37 -0400 Subject: [PATCH 1/2] readme update, html entities in xml removed --- README.md | 9 +-------- source/includes/classes/base.class.php | 6 +++++- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 850c60c..a2b87bf 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ For more information on SemVer, please visit http://semver.org. ##Workflow XboxLiveAPI will be developed using the [GitHub Workflow](http://scottchacon.com/2011/08/31/github-flow.html) as much as possible. All pull requests -must be against the `*-wip` branches. Commits will be made to `*.0.x-dev` branches before being pushed to `master`. +must be against `*-dev` branches. ##Author - Email: me@jasonclemons.me @@ -75,10 +75,3 @@ $data = $api->fetch_friends($gamertag, $region); ```php $data = $api->fetch_search($query, $region); ``` - -## Hacking on XboxLiveAPI - -From the root of the repository, install the tools used to develop. - - $ bundle install - $ npm install diff --git a/source/includes/classes/base.class.php b/source/includes/classes/base.class.php index 7b479e5..fafc269 100644 --- a/source/includes/classes/base.class.php +++ b/source/includes/classes/base.class.php @@ -123,7 +123,7 @@ public function output_error($code) { http_response_code((int)$code); } - if($this->version == "1.0") { + if($this->version == '1.0') { $payload = array( 'Error' => $this->errors[$code], 'In' => round(microtime(true) - $this->runtime, 3), @@ -434,6 +434,10 @@ protected function find($haystack, $start, $finish) { } protected function clean($string) { + if($this->format == 'xml') { + return $string; + } + $string = html_entity_decode($string, ENT_QUOTES, 'UTF-8'); $string = htmlentities($string, ENT_QUOTES, 'UTF-8'); From 8d8c59716d95458399476c7c62d7adf7b53dd0cd Mon Sep 17 00:00:00 2001 From: Jason Clemons Date: Sat, 13 Jul 2013 11:51:04 -0400 Subject: [PATCH 2/2] response status and version for xml fix --- source/includes/classes/base.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/classes/base.class.php b/source/includes/classes/base.class.php index fafc269..61611d9 100644 --- a/source/includes/classes/base.class.php +++ b/source/includes/classes/base.class.php @@ -515,7 +515,7 @@ function output_pretty_jsonp($json, $callback) { */ function output_pretty_xml($mixed, $xml = false) { if($xml === false) { - $xml = new SimpleXMLElement(''); + $xml = new SimpleXMLElement(''); } foreach($mixed as $key => $value) {