git.cweiske.de
/
shpub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2989cd2
)
Add additional check to prevent sending direct uploads with JSON requests
author
Aaron Parecki
<aaron@parecki.com>
Wed, 22 Mar 2017 18:47:13 +0000
(11:47 -0700)
committer
Christian Weiske
<cweiske@cweiske.de>
Thu, 23 Mar 2017 06:41:14 +0000
(07:41 +0100)
src/shpub/Request.php
patch
|
blob
|
history
diff --git
a/src/shpub/Request.php
b/src/shpub/Request.php
index 8262863d7ce3500c30b03d3edfdffb17a9d55f70..07138720c26cf7a4cc3f4139547d66a00746f69a 100644
(file)
--- a/
src/shpub/Request.php
+++ b/
src/shpub/Request.php
@@
-148,6
+148,12
@@
class Request
*/
public function addUpload($fieldName, $fileNames)
{
*/
public function addUpload($fieldName, $fileNames)
{
+ if ($this->directUpload && $this->sendAsJson) {
+ throw new \Exception(
+ 'Cannot do direct upload with JSON requests'
+ );
+ }
+
if ($this->host->endpoints->media === null
|| $this->directUpload
) {
if ($this->host->endpoints->media === null
|| $this->directUpload
) {