Fix WOFileUtils
This commit is contained in:
@@ -173,6 +173,7 @@ Apps & Tools shipped with WordOps :
|
|||||||
- [ClamAV](https://github.com/Cisco-Talos/clamav-devel)
|
- [ClamAV](https://github.com/Cisco-Talos/clamav-devel)
|
||||||
- [cheat.sh](https://github.com/chubin/cheat.sh)
|
- [cheat.sh](https://github.com/chubin/cheat.sh)
|
||||||
- [ProFTPd](https://github.com/proftpd/proftpd)
|
- [ProFTPd](https://github.com/proftpd/proftpd)
|
||||||
|
- [nginx-ultimate-bad-bot-blocker](https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/)
|
||||||
|
|
||||||
Cache Plugins supported by WordOps :
|
Cache Plugins supported by WordOps :
|
||||||
|
|
||||||
|
|||||||
@@ -280,15 +280,15 @@ class WOFileUtils():
|
|||||||
"""
|
"""
|
||||||
Searches for string in file and returns True or False.
|
Searches for string in file and returns True or False.
|
||||||
"""
|
"""
|
||||||
if os.path.isfile(fnm):
|
if os.path.isfile('{0}'.format(fnm)):
|
||||||
try:
|
try:
|
||||||
Log.debug(self, "Finding string {0} to file {1}"
|
Log.debug(self, "Finding string {0} to file {1}"
|
||||||
.format(sstr, fnm))
|
.format(sstr, fnm))
|
||||||
for line in open(fnm, encoding='utf-8'):
|
for line in open(fnm, encoding='utf-8'):
|
||||||
if sstr in line:
|
if sstr in line:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
Log.debug(self, "{0}".format(e.strerror))
|
Log.debug(self, "{0}".format(e.strerror))
|
||||||
Log.error(self, "Unable to Search string {0} in {1}"
|
Log.error(self, "Unable to Search string {0} in {1}"
|
||||||
.format(sstr, fnm))
|
.format(sstr, fnm))
|
||||||
|
|||||||
Reference in New Issue
Block a user