mirror of
https://github.com/e107inc/e107.git
synced 2025-04-21 13:11:52 +02:00
file inspector text search enhancements
This commit is contained in:
parent
5102aaa5f6
commit
159de2bbe0
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/fileinspector.php,v $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2006-12-07 16:18:51 $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2006-12-19 01:55:23 $
|
||||
| $Author: sweetas $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -53,6 +53,7 @@ class file_inspector {
|
||||
var $parent;
|
||||
var $count = array();
|
||||
var $results = 0;
|
||||
var $line_results = 0;
|
||||
|
||||
function file_inspector() {
|
||||
global $e107;
|
||||
@ -177,6 +178,15 @@ class file_inspector {
|
||||
<input type='checkbox' name='line' value='1'".(($_POST['line'] || !isset($_POST['line'])) ? " checked='checked'" : "")." />
|
||||
</td>
|
||||
</tr>";
|
||||
|
||||
$text .= "<tr>
|
||||
<td class='forumheader3' style='width: 35%'>
|
||||
".FC_LAN_22.":
|
||||
</td>
|
||||
<td colspan='2' class='forumheader3' style='width: 65%'>
|
||||
<input type='checkbox' name='highlight' value='1'".(($_POST['highlight'] || !isset($_POST['highlight'])) ? " checked='checked'" : "")." />
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
$text .= "<tr>
|
||||
@ -264,6 +274,7 @@ class file_inspector {
|
||||
$dir_icon = 'fileinspector.png';
|
||||
$parent_expand = TRUE;
|
||||
$this -> results++;
|
||||
$this -> line_results += count($this -> files[$dir_id][$fid]['lines']);
|
||||
} else {
|
||||
unset($this -> files[$dir_id][$fid]);
|
||||
$known[$dir_id][$fid] = true;
|
||||
@ -421,7 +432,7 @@ class file_inspector {
|
||||
}
|
||||
|
||||
function scan_results() {
|
||||
global $ns, $rs, $core_image, $deprecated_image, $imode;
|
||||
global $ns, $rs, $core_image, $deprecated_image, $imode, $tp;
|
||||
$scan_text = $this -> inspect($core_image, $deprecated_image, 0, $this -> root_dir);
|
||||
|
||||
if ($_POST['type'] == 'tree') {
|
||||
@ -479,6 +490,11 @@ class file_inspector {
|
||||
if ($_POST['core'] == 'all') {
|
||||
$text .= "<tr><td class='f'><img src='".e_IMAGE."packs/".$imode."/fileinspector/file.png' class='i' alt='' /> ".FR_LAN_6.": ".($this -> count['core']['num'] + $this -> count['unknown']['num'] + $this -> count['deprecated']['num'])." </td><td class='s'>".$this -> parsesize($this -> count['core']['size'] + $this -> count['unknown']['size'] + $this -> count['deprecated']['size'], 2)."</td></tr>";
|
||||
}
|
||||
if ($_POST['regex']) {
|
||||
$text .= "<tr><td class='f'><img src='".e_IMAGE."packs/".$imode."/fileinspector/file.png' class='i' alt='' /> ".FR_LAN_29.": ".($this -> results)." </td><td class='s'> </td></tr>";
|
||||
$text .= "<tr><td class='f'><img src='".e_IMAGE."packs/".$imode."/fileinspector/file.png' class='i' alt='' /> ".FR_LAN_30.": ".($this -> line_results)." </td><td class='s'> </td></tr>";
|
||||
}
|
||||
|
||||
|
||||
if ($this -> count['warning']['num']) {
|
||||
$text .= "<tr><td colspan='2'> </td></tr>";
|
||||
@ -564,7 +580,11 @@ class file_inspector {
|
||||
$text .= "[".($rkey + 1)."] ";
|
||||
}
|
||||
if ($_POST['line']) {
|
||||
$text .= htmlspecialchars($rvalue)."<br />";
|
||||
if ($_POST['highlight']) {
|
||||
$text .= $tp -> e_highlight(htmlspecialchars($rvalue), $_POST['regex'])."<br />";
|
||||
} else {
|
||||
$text .= htmlspecialchars($rvalue)."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
$text .= "<br />";
|
||||
@ -613,8 +633,8 @@ class file_inspector {
|
||||
$data .= "| GNU General Public License (http://gnu.org).\n";
|
||||
$data .= "|\n";
|
||||
$data .= "| \$Source: /cvs_backup/e107_0.8/e107_admin/fileinspector.php,v $\n";
|
||||
$data .= "| \$Revision: 1.2 $\n";
|
||||
$data .= "| \$Date: 2006-12-07 16:18:51 $\n";
|
||||
$data .= "| \$Revision: 1.3 $\n";
|
||||
$data .= "| \$Date: 2006-12-19 01:55:23 $\n";
|
||||
$data .= "| \$Author: sweetas $\n";
|
||||
$data .= "+----------------------------------------------------------------------------+\n";
|
||||
$data .= "*/\n\n";
|
||||
|
@ -4,9 +4,9 @@
|
||||
| e107 website system - Language File.
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_fileinspector.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:34:40 $
|
||||
| $Author: mcfly_e107 $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2006-12-19 01:55:23 $
|
||||
| $Author: sweetas $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@ -31,6 +31,7 @@ define("FC_LAN_18", "Regular expression");
|
||||
define("FC_LAN_19", "Show line numbers");
|
||||
define("FC_LAN_20", "Show matched lines");
|
||||
define("FC_LAN_21", "Old Core Files");
|
||||
define("FC_LAN_22", "Highlight matched text");
|
||||
|
||||
define("FR_LAN_1", "Scanning");
|
||||
define("FR_LAN_2", "Scan Results");
|
||||
@ -70,4 +71,7 @@ define("FR_LAN_26", "Warning! Known Insecurity Detected!");
|
||||
define("FR_LAN_27", "There are files on your server that are known to be exploitable and must be removed immediately.");
|
||||
define("FR_LAN_28", "Known insecure files");
|
||||
|
||||
define("FR_LAN_29", "Total files matched");
|
||||
define("FR_LAN_30", "Total lines matched");
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user