Created
January 21, 2019 21:03
-
-
Save ajnyga/a0d2fd12d20990793e687fbe33183c97 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_map("filter", file("lib/pkp/plugins/generic/usageStats/lib/counterBots/generated/COUNTER_Robots_list.txt")); | |
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; | |
} | |
} | |
return $regexp; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment