This commit is contained in:
Roly Rudy Gutierrez Pinto
2019-02-19 12:47:43 -04:00
parent 04d4cefa24
commit df4676daf1
3 changed files with 18 additions and 4 deletions

View File

@@ -98,7 +98,9 @@ class MySQLiResultSet extends ResultSetCommon implements ResultSet {
*/ */
public function close() public function close()
{ {
@mysqli_free_result($this->result); if (is_resource($this->result)) {
@mysqli_free_result($this->result);
}
$this->fields = array(); $this->fields = array();
} }

View File

@@ -379,7 +379,13 @@ class DB_mysqli extends DB_common
# need to come up with different means for next line # need to come up with different means for next line
# since $result is object (int)$result won't fly... # since $result is object (int)$result won't fly...
// unset($this->num_rows[(int)$result]); // unset($this->num_rows[(int)$result]);
return @mysqli_free_result($result);
//for compatibility the method must return a boolean.
if (is_resource($result)) {
@mysqli_free_result($result);
return true;
}
return false;
} }
// }}} // }}}
@@ -902,7 +908,9 @@ class DB_mysqli extends DB_common
// free the result only if we were called on a table // free the result only if we were called on a table
if ($got_string) { if ($got_string) {
@mysqli_free_result($id); if (is_resource($id)) {
@mysqli_free_result($id);
}
} }
return $res; return $res;
} }

View File

@@ -944,6 +944,8 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
* *
* @param string resource path to check for locks * @param string resource path to check for locks
* @return bool true on success * @return bool true on success
* @link https://wiki.processmaker.com/index.php/WebDAV
* @deprecated
*/ */
public function checkLock($path) public function checkLock($path)
{ {
@@ -959,7 +961,9 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
if ($res) { if ($res) {
$row = mysqli_fetch_array($res); $row = mysqli_fetch_array($res);
mysqli_free_result($res); if (is_resource($res)) {
mysqli_free_result($res);
}
if ($row) { if ($row) {
$result = array("type" => "write", "scope" => $row["exclusivelock"] ? "exclusive" : "shared", "depth" => 0, "owner" => $row['owner'], "token" => $row['token'], "expires" => $row['expires'] $result = array("type" => "write", "scope" => $row["exclusivelock"] ? "exclusive" : "shared", "depth" => 0, "owner" => $row['owner'], "token" => $row['token'], "expires" => $row['expires']