Skip to content

Commit

Permalink
This fixes an issue for cases that $_REQUEST is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
giannis committed Dec 21, 2017
1 parent 587dc40 commit ad62c46
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions email.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,13 @@ private function validate($type="", $param=array()) {
}

static public function send($param="", $extra=array(), $attachments=array()) {
$that = static::$instance;

$that = static::$instance;
$request = !empty($_REQUEST) ? $_REQUEST : array();

if (empty($param))
return $that->_response_output("EMAIL_FAIL", "no parameters passed");

$extra = array_merge($extra, $_REQUEST);
$extra = array_merge($extra, $request);

$valid = $that->validate($param, $extra);

Expand All @@ -343,12 +344,13 @@ static public function send($param="", $extra=array(), $attachments=array()) {
}

static public function view($type) {
$that = static::$instance;
$that = static::$instance;
$request = !empty($_REQUEST) ? $_REQUEST : array();

if (empty($type))
return $that->_response_output("EMAIL_FAIL", "Email view not found");

$param = $that->validate($type, $_REQUEST);
$param = $that->validate($type, $request);

if (!is_array($param))
return $that->_response_output("NOT_FOUND", $param);
Expand Down

0 comments on commit ad62c46

Please sign in to comment.