Skip to content

Commit be7589c

Browse files
exclude external urls (catalyst#119)
1 parent 534c26b commit be7589c

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* [Installation](#installation)
77
* [Configuration](#configuration)
88
* [Testing](#testing)
9+
* [Debugging](#debugging)
910
* [Reports](#reports)
1011
* [Support](#support)
1112
* [Warm thanks](#warm-thanks)
@@ -184,6 +185,14 @@ and
184185

185186
/admin/tool/crawler/report.php?report=recent
186187

188+
# Debugging
189+
190+
You can also run link crawler on given page by passing url. You might need to Reset Progress if its still running from Administration > Reports > Link crawler -> Robot status
191+
192+
```
193+
php admin/tool/crawler/cli/crawl-as.php --url=http://localhost/
194+
```
195+
187196
# Reports
188197

189198
4 new admin reports are available for showing the current crawl status, broken

classes/robot/crawler.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ public function mark_for_crawl($baseurl, $url, $courseid = null, $priority = TOO
333333
$isexcluded = false;
334334
// If this URL is external then check the ext whitelist.
335335
if (!self::is_external($url)) {
336-
$excludes = str_replace("\r", '', self::get_config()->excludemdlurl);
336+
$excludes = str_replace(PHP_EOL, ',', self::get_config()->excludemdlurl);
337337
} else {
338-
$excludes = str_replace("\r", '', self::get_config()->excludeexturl);
338+
$excludes = str_replace(PHP_EOL, ',', self::get_config()->excludemdlurl);
339339
}
340340

341341
$isexcluded = profiling_string_matches($url, $excludes);

version.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
defined('MOODLE_INTERNAL') || die();
2828

2929

30-
$plugin->version = 2020030300; // The current plugin version (Date: YYYYMMDDXX)
31-
$plugin->release = 2020030300; // The current plugin version (Date: YYYYMMDDXX)
30+
$plugin->version = 2020030500; // The current plugin version (Date: YYYYMMDDXX)
31+
$plugin->release = 2020030500; // The current plugin version (Date: YYYYMMDDXX)
3232
$plugin->requires = 2016021800; // Requires this Moodle version.
3333
$plugin->component = 'tool_crawler'; // To check on upgrade, that module sits in correct place.
3434
$plugin->maturity = MATURITY_STABLE;

0 commit comments

Comments
 (0)