2020-06-03 00:43:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter\Hooks;
|
|
|
|
|
2024-10-19 19:55:40 +00:00
|
|
|
use MediaWiki\Content\Content;
|
2020-06-03 00:43:22 +00:00
|
|
|
|
|
|
|
interface AbuseFilterContentToStringHook {
|
|
|
|
/**
|
|
|
|
* Hook runner for the `AbuseFilter-contentToString` hook
|
|
|
|
*
|
|
|
|
* Called when converting a Content object to a string to which
|
|
|
|
* filters can be applied. If the hook function returns true, Content::getTextForSearchIndex()
|
|
|
|
* will be used for non-text content.
|
|
|
|
*
|
|
|
|
* @param Content $content
|
2021-03-31 19:40:43 +00:00
|
|
|
* @param ?string &$text Set this to the desired text
|
2020-06-03 00:43:22 +00:00
|
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
|
|
*/
|
2021-03-06 17:18:07 +00:00
|
|
|
public function onAbuseFilter_contentToString(
|
2020-06-03 00:43:22 +00:00
|
|
|
Content $content,
|
|
|
|
?string &$text
|
|
|
|
);
|
|
|
|
}
|