mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-22 06:28:46 -04:00
made all php unit tests pass again
This commit is contained in:
parent
59569bf9fc
commit
700f8a0ea7
11 changed files with 158 additions and 255 deletions
|
@ -208,6 +208,13 @@ class Controller
|
|||
|
||||
// Ensure content is not too big.
|
||||
$data = $this->_request->getData();
|
||||
$isComment = array_key_exists('pasteid', $data) &&
|
||||
!empty($data['pasteid']) &&
|
||||
array_key_exists('parentid', $data) &&
|
||||
!empty($data['parentid']);
|
||||
if (!FormatV2::isValid($data, $isComment)) {
|
||||
return $this->_return_message(1, 'Invalid data.');
|
||||
}
|
||||
$sizelimit = $this->_conf->getKey('sizelimit');
|
||||
if (strlen($data['ct']) > $sizelimit) {
|
||||
return $this->_return_message(
|
||||
|
@ -220,7 +227,7 @@ class Controller
|
|||
}
|
||||
|
||||
// The user posts a comment.
|
||||
if (!empty($data['pasteid']) && !empty($data['parentid'])) {
|
||||
if ($isComment) {
|
||||
$paste = $this->_model->getPaste($data['pasteid']);
|
||||
if ($paste->exists()) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue