Funktion clearHtmlTags zur Bereinigung von ul, li und br-Tags

Anwendung auf Lehrinhalte in Zertifikat
This commit is contained in:
Martin Tatzber
2014-02-24 08:58:00 +00:00
parent b7ad289788
commit 0d5a89a96b
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -882,4 +882,19 @@ function decryptData($value,$key)
$decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypttext, MCRYPT_MODE_ECB, $iv);
return trim($decrypttext);
}
function clearHtmlTags($text)
{
$text=mb_str_replace('<br>','\n',$text);
$text=mb_str_replace('<br/>','\n',$text);
$text=mb_str_replace('<br />','\n',$text);
$text=mb_str_replace('<ul>\n','',$text);
$text=mb_str_replace('<ul>','',$text);
$text=mb_str_replace('</ul>','',$text);
$text=mb_str_replace('<li>','\n - ',$text);
$text=mb_str_replace('</li>','',$text);
return $text;
}
?>
+1
View File
@@ -236,6 +236,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
$xml .= " <sws>".($sws==0?'':number_format(sprintf('%.1F',$sws),1))."</sws>";
$xml .= " <ects>".number_format($ects,1)."</ects>";
$xml .= " <lvleiter>".$leiter_titel." ".$leiter_vorname." ".$leiter_nachname.($leiter_titelpost!=''?', '.$leiter_titelpost:'')."</lvleiter>";
// $xml .= " <lehrinhalte><![CDATA[".clearHtmlTags($lehrinhalte)."]]></lehrinhalte>";
$xml .= " <lehrinhalte><![CDATA[".$lehrinhalte."]]></lehrinhalte>";