MDL-52214 core: Fix the is_web_crawler() regression
In MDL-50891, the is_web_crawler() was refactored into a core_useragent method and the function itself was deprecated. However, there were no unit tests kept to check the backwards compatible behaviour. It turned out that the deprecated function leads to PHP fatal error due to a typo. This patch fixes the typo and brings back the previous unit tests. To be able to explicitly check the raised debugging message, the test case now must be subclass of advanced_testcase. Additionally fixes missing info about the function being deprecated.
This commit is contained in:
@@ -2395,8 +2395,8 @@ function get_referer($stripquery = true) {
|
||||
* @deprecated since Moodle 3.0 use \core_useragent::is_web_crawler instead.
|
||||
*/
|
||||
function is_web_crawler() {
|
||||
debugging("is_web_crawler() has been deprecated, please use \\core_useragent\\is_web_crawler() instead.", DEBUG_DEVELOPER);
|
||||
return core_useragent::is_crawler();
|
||||
debugging('is_web_crawler() has been deprecated, please use core_useragent::is_web_crawler() instead.', DEBUG_DEVELOPER);
|
||||
return core_useragent::is_web_crawler();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user