e107_handlers/file_class.php
Consider simplifying this complex logical expression. Open
Open
if(($file != '.') && ($file != '..') && !in_array($file, $this->dirFilter) && !in_array($file, $omit) && is_dir($path . '/' . $file) && ($fmask == '' || preg_match("#" . $fmask . "#", $file)))
{
$ret[] = $file;
}
Avoid deeply nested control flow statements. Open
Open
if(!unlink($dir . $obj))
{
return false;
}
Avoid deeply nested control flow statements. Open
Open
if(rename($path_to_file, $newFile) === true)
{
$finfo['pathinfo'] = pathinfo($newFile);
$path_to_file = $newFile;
}
Avoid deeply nested control flow statements. Open
Open
if(!$this->rmtree($dir . $obj))
{
return false;
}
Avoid too many return
statements within this method. Open
Open
return true; // Accepted here
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return $fileContents;
Avoid too many return
statements within this method. Open
Open
return round($size / $tb, 2) . " " . CORE_LAN_TB;
Call to method file
from undeclared class \finfo
Open
Open
list($mime, $other) = explode(";", $fin->file($path_to_file));
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_close()
takes resource
Open
Open
curl_close($cp);
- Exclude checks
string
passed to foreach instead of array Open
Open
foreach($temp_vars['class'] as $v1)
- Exclude checks
Reference to undeclared constant \FILEINFO_MIME
Open
Open
$fin = new finfo(FILEINFO_MIME);
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_setopt()
takes resource
Open
Open
curl_setopt($cp, CURLOPT_FILE, $fp);
- Exclude checks
Argument 2 (newvalue)
is 600
but \ini_set()
takes string
Open
Open
@ini_set("max_execution_time", 10 * 60);
- Exclude checks
Call with 2 arg(s) to \user_class::getClassFromKey()
which only takes 1 arg(s) defined at /code/e107_handlers/userclass_class.php:122
Open
Open
$v['name'] = e107::getUserClass()->getClassFromKey($v['name'], $v['name']); // convert 'admin' etc to numeric equivalent.
- Exclude checks
Invalid offset "type"
of array type array{}
Open
Open
$contentType = vartrue($opts['type'], 'application/force-download');
- Exclude checks
Returning type false
but unzipArchive()
is declared to return string
Open
Open
return false;
- Exclude checks
Call to method __construct
from undeclared class \PclZip
Open
Open
$archive = new PclZip(e_TEMP . $localfile);
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_setopt()
takes resource
Open
Open
curl_setopt($cp, CURLOPT_TIMEOUT, $timeout);
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_error()
takes resource
Open
Open
if(curl_error($cu))
- Exclude checks
Default value for string
$fileinfo
can't be false
Open
Open
public function getUploaded($uploaddir, $fileinfo = false, $options = array())
- Exclude checks
Return type of initCurl()
is undeclared type \CurlHandle
Open
Open
public function initCurl($address, $options = null)
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_exec()
takes resource
Open
Open
$fileContents = curl_exec($cu);
- Exclude checks
Argument 2 (newvalue)
is 5
but \ini_set()
takes string
Open
Open
$old_timeout = ini_set('default_socket_timeout', $timeout);
- Exclude checks
Returning type false
but getRemoteContent()
is declared to return string
Open
Open
return false;
- Exclude checks
Returning type string
but getErrorMessage()
is declared to return null
Open
Open
return $this->error;
- Exclude checks
Returning type false
but getRemoteContent()
is declared to return string
Open
Open
return false;
- Exclude checks
Argument 3 (subject)
is null
but \str_replace()
takes array|string
Open
Open
$ext = str_replace(",", "|", $extensions);
- Exclude checks
Variable $current_perms
was undeclared, but array fields are being added to it. Open
Open
$current_perms[$v['name']] = array('type' => $v['type'], 'maxupload' => $v['maxupload']);
- Exclude checks
Variable $finfo
was undeclared, but array fields are being added to it. Open
Open
$finfo['path'] = $path . '/'; // important: leave this slash here and update other file instead.
- Exclude checks
Reference to undeclared constant \e_CURL_PROXYUSERPWD
Open
Open
curl_setopt($cu, CURLOPT_PROXYUSERPWD, e_CURL_PROXYUSERPWD); // Use if proxy have username and password
- Exclude checks
Reference to undeclared constant \e_CURL_PROXYTYPE
Open
Open
curl_setopt($cu, CURLOPT_PROXYTYPE, e_CURL_PROXYTYPE); // If expected to cal
- Exclude checks
Returning type false
but getRemoteContent()
is declared to return string
Open
Open
return false;
- Exclude checks
Argument 2 (newvalue)
is 1
but \ini_set()
takes string
Open
Open
ini_set('default_socket_timeout', 1);
- Exclude checks
Returning type false
but unzipArchive()
is declared to return string
Open
Open
return false;
- Exclude checks
Call to method __construct
from undeclared class \finfo
Open
Open
$fin = new finfo(FILEINFO_MIME);
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_error()
takes resource
Open
Open
error_log('cURL error: ' . curl_error($cp));
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_error()
takes resource
Open
Open
$this->error = "Curl error: " . $errorCode . ", " . curl_error($cu);
- Exclude checks
Default value for string
$opts
can't be array{}
Open
Open
function send($file, $opts = array())
- Exclude checks
Invalid offset "disposition"
of array type array{}
Open
Open
$contentDisp = vartrue($opts['disposition'], 'attachment');
- Exclude checks
Argument 2 (newvalue)
is 600
but \ini_set()
takes string
Open
Open
@ini_set("max_execution_time", 10 * 60);
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_exec()
takes resource
Open
Open
$buffer = curl_exec($cp);
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_errno()
takes resource
Open
Open
$errorCode = curl_errno($cu);
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_errno()
takes resource
Open
Open
if(curl_errno($cp)) // Fixes curl_error output - here see #1936
- Exclude checks
Argument 1 (ch)
is \CurlHandle|false
but \curl_close()
takes resource
Open
Open
curl_close($cu);
- Exclude checks
Argument 2 (newvalue)
is 5
but \ini_set()
takes string
Open
Open
$old_timeout = ini_set('default_socket_timeout', $timeout);
- Exclude checks
Reference to undeclared constant \PCLZIP_OPT_SET_CHMOD
Open
Open
$unarc = ($fileList = $archive->extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.
- Exclude checks
Returning type false
but getMime()
is declared to return string
Open
Open
return false;
- Exclude checks
When fetching an array index from a value of type string,
found an array index of type 'class',
but expected the index to be of type int
Open
Open
foreach($temp_vars['class'] as $v1)
- Exclude checks
Reference to undeclared constant \e_CURL_PROXY
Open
Open
curl_setopt($cu, CURLOPT_PROXY, e_CURL_PROXY); // PROXY details with port
- Exclude checks
Returning type false
but getRemoteContent()
is declared to return string
Open
Open
return false;
- Exclude checks
Returning type false
but unzipArchive()
is declared to return string
Open
Open
return false;
- Exclude checks
Returning type false
but getRemoteContent()
is declared to return string
Open
Open
return false;
- Exclude checks
Reference to undeclared constant \PCLZIP_OPT_PATH
Open
Open
$unarc = ($fileList = $archive->extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.
- Exclude checks
Argument 2 (mode)
is null
but \e_file::mkDir()
takes int
defined at /code/e107_handlers/file_class.php:2068
Open
Open
if(($options & FILE_CREATE_DIRECTORY) && @$this->mkDir($directory, null, true))
- Exclude checks
Argument 3 (omit)
is array|array<int>|array<int>|array{0:string}</int></int>
but \e_file::get_files()
takes string
defined at /code/e107_handlers/file_class.php:245
Open
Open
$xx = $this->get_files($path . '/' . $file, $fmask, $omit, $recurse_level - 1);
- Exclude checks
Returning type false
but unzipArchive()
is declared to return string
Open
Open
return false;
- Exclude checks
Call to method extract
from undeclared class \PclZip
Open
Open
$unarc = ($fileList = $archive->extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.
- Exclude checks