1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-03 06:55:03 +03:00

fix вставки cut между парными тегами

This commit is contained in:
Mzhelskiy Maxim 2009-04-11 07:02:48 +00:00
parent 23ab5e461a
commit 18289effee

View file

@ -386,13 +386,14 @@ class ActionTopic extends Action {
$sTextTemp=str_replace("\n",'[<n>]',$sTextTemp);
if (preg_match("/^(.*)<cut(.*)>(.*)$/Ui",$sTextTemp,$aMatch)) {
$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);
@ -532,13 +533,14 @@ class ActionTopic extends Action {
$sTextTemp=str_replace("\n",'[<n>]',$sTextTemp);
if (preg_match("/^(.*)<cut(.*)>(.*)$/Ui",$sTextTemp,$aMatch)) {
$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);