git.cweiske.de
/
phorkie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2e5ea3a
)
fix bug #10: error when nothing submitted
author
Christian Weiske
<cweiske@cweiske.de>
Wed, 6 Jun 2012 11:57:13 +0000
(13:57 +0200)
committer
Christian Weiske
<cweiske@cweiske.de>
Wed, 6 Jun 2012 11:57:13 +0000
(13:57 +0200)
src/phorkie/Repository/Post.php
patch
|
blob
|
history
diff --git
a/src/phorkie/Repository/Post.php
b/src/phorkie/Repository/Post.php
index d104a8c1f3eb17254dac43c325bb8f7beef44669..fe2372f67a1f80a50c60fa2ae12484966024c29d 100644
(file)
--- a/
src/phorkie/Repository/Post.php
+++ b/
src/phorkie/Repository/Post.php
@@
-20,6
+20,9
@@
class Repository_Post
if (!isset($postData['files'])) {
return false;
}
if (!isset($postData['files'])) {
return false;
}
+ if (!$this->hasContent($postData)) {
+ return false;
+ }
if (!$this->repo) {
$this->repo = $this->createRepo();
if (!$this->repo) {
$this->repo = $this->createRepo();
@@
-137,6
+140,19
@@
class Repository_Post
return true;
}
return true;
}
+ protected function hasContent($postData)
+ {
+ foreach ($postData['files'] as $num => $arFile) {
+ if ($_FILES['files']['error'][$num]['upload'] == 0) {
+ return true;
+ }
+ if ($arFile['content'] != '') {
+ return true;
+ }
+ }
+ return false;
+ }
+
public function createRepo()
{
$rs = new Repositories();
public function createRepo()
{
$rs = new Repositories();