diff --git a/functions.php b/functions.php index 476a636..9e718d6 100644 --- a/functions.php +++ b/functions.php @@ -1045,9 +1045,11 @@ function check_content_layout() { }else{ content = (tinymce.activeEditor.getContent() !== '') ? tinymce.activeEditor.getContent() : document.forms.post.elements.content.value; } - if(findTags('span:not(.mce_SELRES_start):not(.mce-preview-object):not(.mce-object-iframe):not(.mce-shim):not(.anchor)',content) !== 0 || !checkUnslosedTags(content)){ + if(findTags('span:not(.mce_SELRES_start):not(.mce-preview-object):not(.mce-object-iframe):not(.mce-shim):not(.anchor)',content) !== 0 + || findTags('div:not(.mce-offscreen-selection):not(.mce-content-body):not(.mce-toolbar-grp):not(.mce-statusbar):not(.mce-preview-object):not(.mce-reset):not(.mce-temp)', content) !== 0 + || !checkUnslosedTags(content)){ console.log('Есть спаны или незакрытые теги'); - alert('Вставленный текст не может быть сохранен и опубликован из-за нарушения требований безопасности сайта. Вставка осуществляется ТОЛЬКО в режиме «Текст»'); + alert('В тексте обнаружены недопустимые HTML-теги, несовместимые с форматированием текстов «Профиля». Откройте редактор в режиме «Код» и уберите все ненужные ,
и др., прежде чем сохранить'); return false; }else{ console.log('Все ок'); @@ -6849,8 +6851,12 @@ add_action("save_post", function($post_id){ if(get_post_status($post_id) === "publish"){ - rocket_clean_files(['https://g.profile.ru/author']); - rocket_clean_files(['https://profile.ru/author']); + if (function_exists ('rocket_clean_files' ) ){ + + rocket_clean_files(['https://g.profile.ru/author']); + rocket_clean_files(['https://profile.ru/author']); + + } }