Skip to content

Commit 0b4af37

Browse files
author
davydovct
committed
add jscode in case when something wrong with patching
1 parent 410664c commit 0b4af37

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cleantalk.antispam/include.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,8 @@ function OnEventLogGetAuditTypesHandler(){
906906
* @param string Content to modify
907907
*/
908908
function OnEndBufferContentHandler(&$content) {
909-
if(!defined("ADMIN_SECTION") && COption::GetOptionString( 'cleantalk.antispam', 'status', 0 ) == 1 && strpos($content,'</body>') !== false)
910-
{
911-
}
909+
if(!defined("ADMIN_SECTION") && COption::GetOptionString( 'cleantalk.antispam', 'status', 0 ) == 1 && strpos($content,'<!-- CLEANTALK template addon -->') === false && strpos($content,'</body>') !== false)
910+
$content = preg_replace('/(<\/body[^>]*>)/i', '${1}'."\n".self::FormAddon(), $content, 1);
912911
}
913912
/**
914913
* Deprecated!

0 commit comments

Comments
 (0)