mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-01 05:55:02 +03:00
fix вставки cut между парными тегами
This commit is contained in:
parent
23ab5e461a
commit
18289effee
|
@ -379,20 +379,21 @@ class ActionTopic extends Action {
|
|||
$sText=$this->Text_Parser(getRequest('topic_text'));
|
||||
/**
|
||||
* Создаёт анонс топика(обрезаем по тег <cut>)
|
||||
*/
|
||||
*/
|
||||
$sTestShort=$sText;
|
||||
$sTestNew=$sText;
|
||||
$sTextTemp=str_replace("\r\n",'[<rn>]',$sText);
|
||||
$sTextTemp=str_replace("\n",'[<n>]',$sTextTemp);
|
||||
if (preg_match("/^(.*)<cut(.*)>(.*)$/Ui",$sTextTemp,$aMatch)) {
|
||||
$sTestShort=$aMatch[1];
|
||||
$sTestNew=$aMatch[1].' '.$aMatch[3];
|
||||
$sTestShort=$aMatch[1];
|
||||
$sTestShort=str_replace('[<rn>]',"\r\n",$sTestShort);
|
||||
$sTestShort=str_replace('[<n>]',"\r\n",$sTestShort);
|
||||
$sTestShort=$this->Text_Parser($sTestShort);
|
||||
$sTestNew=$aMatch[1].' '.$aMatch[3];
|
||||
if (preg_match('/^\s*name\s*=\s*"(.+)"\s*$/Ui',$aMatch[2],$aMatchCut)) {
|
||||
$oTopic->setCutText(trim($aMatchCut[1]));
|
||||
}
|
||||
}
|
||||
$sTestShort=str_replace('[<rn>]',"\r\n",$sTestShort);
|
||||
$sTestShort=str_replace('[<n>]',"\r\n",$sTestShort);
|
||||
}
|
||||
$sTestNew=str_replace('[<rn>]',"\r\n",$sTestNew);
|
||||
$sTestNew=str_replace('[<n>]',"\r\n",$sTestNew);
|
||||
|
||||
|
@ -531,14 +532,15 @@ class ActionTopic extends Action {
|
|||
$sTextTemp=str_replace("\r\n",'[<rn>]',$sText);
|
||||
$sTextTemp=str_replace("\n",'[<n>]',$sTextTemp);
|
||||
if (preg_match("/^(.*)<cut(.*)>(.*)$/Ui",$sTextTemp,$aMatch)) {
|
||||
$sTestShort=$aMatch[1];
|
||||
$sTestShort=$aMatch[1];
|
||||
$sTestShort=str_replace('[<rn>]',"\r\n",$sTestShort);
|
||||
$sTestShort=str_replace('[<n>]',"\r\n",$sTestShort);
|
||||
$sTestShort=$this->Text_Parser($sTestShort);
|
||||
$sTestNew=$aMatch[1].' '.$aMatch[3];
|
||||
if (preg_match('/^\s*name\s*=\s*"(.+)"\s*$/Ui',$aMatch[2],$aMatchCut)) {
|
||||
$oTopic->setCutText(trim($aMatchCut[1]));
|
||||
}
|
||||
}
|
||||
$sTestShort=str_replace('[<rn>]',"\r\n",$sTestShort);
|
||||
$sTestShort=str_replace('[<n>]',"\r\n",$sTestShort);
|
||||
}
|
||||
$sTestNew=str_replace('[<rn>]',"\r\n",$sTestNew);
|
||||
$sTestNew=str_replace('[<n>]',"\r\n",$sTestNew);
|
||||
|
||||
|
|
Loading…
Reference in a new issue