Skip to content

Commit

Permalink
Не проверяем сертификата узла. При поиске первого вхождения элемента …
Browse files Browse the repository at this point in the history
…по first(), выполняем это корректно
  • Loading branch information
kazartsev committed Sep 13, 2016
1 parent c673f36 commit 1e7b6ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Sberned/RestORM/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function send()
if($this->basicAuth) {
$result->setUser($this->authLogin())->setPass($this->authPass());
}

$result->setOption(CURLOPT_SSL_VERIFYPEER, false);
$res = $result->send();
if($res->statusCode < 400) {
$this->result = Model::convertToObject(json_decode($res->body));
Expand Down
5 changes: 3 additions & 2 deletions src/Sberned/RestORM/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ public function first(array $columns = [])
$dataObj = $aliasList;
}

if (empty($res->$dataObj)) {
return null;
if (!empty($res->$dataObj)) {
$data = array_first($res->$dataObj);
if(!empty($data)) {
foreach ($data as $key => $val) {
Expand All @@ -187,6 +186,8 @@ public function first(array $columns = [])
}
$class->exist = true;
return $class;
} else {
return null;
}
}

Expand Down

0 comments on commit 1e7b6ac

Please sign in to comment.