Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added getBinary so it is possible to access raw binary data in the re…

…quest body without it being modified by the utf-8 cleaner
  • Loading branch information...
commit 7c2f919993f5ccb04a0fa1bf54e657fadd6ceed0 1 parent 4e2c0d4
Rik authored

Showing 1 changed file with 18 additions and 0 deletions. Show diff stats Hide diff stats

  1. +18 0 http/RequestParams.php
18 http/RequestParams.php
@@ -122,6 +122,24 @@ public function get($name, $default='')
122 122
123 123
124 124 /**
  125 + * If the content is binary, this will return the raw content, unmodified.
  126 + * Use with care and attention.
  127 + * @param $name
  128 + * @param null $default
  129 + * @return null
  130 + */
  131 + public function getBinary($name, $default=null)
  132 + {
  133 + if (!array_key_exists($name, $this->all)) {
  134 + return $default;
  135 + }
  136 +
  137 + // return the raw, unmodified content - here be dragons...
  138 + return $this->all[$name];
  139 + }
  140 +
  141 +
  142 + /**
125 143 * Returns a bool of true or false from the value
126 144 * @param $name
127 145 * @param bool $default

0 comments on commit 7c2f919

Please sign in to comment.
Something went wrong with that request. Please try again.