Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordfenc.../lib
File: wfScanPath.php
<?php
[0] Fix | Delete
[1] Fix | Delete
require_once __DIR__ . '/wfFileUtils.php';
[2] Fix | Delete
require_once __DIR__ . '/wfScanFile.php';
[3] Fix | Delete
require_once __DIR__ . '/wfScanFileLink.php';
[4] Fix | Delete
[5] Fix | Delete
class wfScanPath {
[6] Fix | Delete
[7] Fix | Delete
private $baseDirectory;
[8] Fix | Delete
private $path;
[9] Fix | Delete
private $realPath;
[10] Fix | Delete
private $wordpressPath;
[11] Fix | Delete
private $expectedFiles;
[12] Fix | Delete
[13] Fix | Delete
public function __construct($baseDirectory, $path, $wordpressPath = null, $expectedFiles = null) {
[14] Fix | Delete
$this->baseDirectory = $baseDirectory;
[15] Fix | Delete
$this->path = $path;
[16] Fix | Delete
$this->realPath = wfFileUtils::realPath($path);
[17] Fix | Delete
$this->wordpressPath = $wordpressPath;
[18] Fix | Delete
$this->expectedFiles = is_array($expectedFiles) ? array_flip($expectedFiles) : null;
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
public function getPath() {
[22] Fix | Delete
return $this->path;
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
public function getRealPath() {
[26] Fix | Delete
return $this->realPath;
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
public function getWordpressPath() {
[30] Fix | Delete
return $this->wordpressPath;
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
public function hasExpectedFiles() {
[34] Fix | Delete
return $this->expectedFiles !== null && !empty($this->expectedFiles);
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
public function expectsFile($name) {
[38] Fix | Delete
return array_key_exists($name, $this->expectedFiles);
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
public function isBaseDirectory() {
[42] Fix | Delete
return $this->path === $this->baseDirectory;
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
public function isBelowBaseDirectory() {
[46] Fix | Delete
return wfFileUtils::belongsTo($this->path, $this->baseDirectory);
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
public function getContents() {
[50] Fix | Delete
return wfFileUtils::getContents($this->realPath);
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
public function createScanFile($relativePath) {
[54] Fix | Delete
$path = wfFileUtils::joinPaths($this->realPath, $relativePath);
[55] Fix | Delete
$realPath = wfFileUtils::realPath($path);
[56] Fix | Delete
$wordpressPath = wfFileUtils::trimSeparators(wfFileUtils::joinPaths($this->wordpressPath, $relativePath), true, false);
[57] Fix | Delete
if (is_link($path)) {
[58] Fix | Delete
return new wfScanFileLink($path, $realPath, $wordpressPath);
[59] Fix | Delete
}
[60] Fix | Delete
else {
[61] Fix | Delete
return new wfScanFile($realPath, $wordpressPath);
[62] Fix | Delete
}
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
public function __toString() {
[66] Fix | Delete
return $this->realPath;
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
}
[70] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function