Redirect stderr of wc to /dev/null due to vanished files.
This commit is contained in:
parent
784e17c0c9
commit
077359976a
|
@ -65,7 +65,7 @@ while read file; do
|
|||
elif [[ "$file" =~ "wp-content/uploads/" ]]; then
|
||||
echo "PHP file in a non-PHP folder detected: $file"
|
||||
# Count the length of the longest line and search if suspect php functions are used.
|
||||
elif [[ $($wc -L "$file" | cut -d' ' -f1) -gt 10000 ]]; then
|
||||
elif [[ $($wc -L "$file" 2>/dev/null | cut -d' ' -f1) -gt 10000 ]]; then
|
||||
grep -q -E "$suspect" "$file"
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo "Suspect file! More than 10000 characters in one line (and suspect PHP functions): $file."
|
||||
|
@ -104,4 +104,4 @@ if ( $aggressive ); then
|
|||
$grep -r 'eval(' .
|
||||
$grep -r '\x..\x..' .
|
||||
$grep -r 'chr(rand(' .
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue