Created
January 21, 2019 20:26
-
-
Save ajnyga/b56a37c2443129945178c31cc5080dc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$botRegexps = array_filter(file("lib/pkp/plugins/generic/usageStats/lib/counterBots/generated/COUNTER_Robots_list.txt"), "filter"); | |
print_r($botRegexps); | |
function filter(&$regexp) | |
{ | |
$delimiter = '/'; | |
$regexp = trim($regexp); | |
if (!empty($regexp) && $regexp[0] != '#') { | |
if(strpos($regexp, $delimiter) !== 0) { | |
// Make sure delimiters are in place. | |
$regexp = $delimiter . $regexp . $delimiter; | |
} | |
} else { | |
return false; | |
} | |
return true; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment