Welcome,
Guest
|
|
Try this ...
static function filterText($text) { if ( strpos( $text, '{lang' ) === false ) return $text; //<Des>// Correction mangled closing tags $sh_this = array("{/lang ...", "{/lan ...", "{/la ...", "{/l ...", "{/ ...", "{ ..."); $text = str_replace($sh_this, "{/lang} ...", $text); //<Des>//Correction crumpled opening tag $sh_this = array("{lang ...", "{lang ...", "{lan ...", "{la ...", "{l ..."); $text = str_replace($sh_this, " ...", $text); //<Des>// Adding redundant closing tags for all the lost $text = str_replace(" ...", "{/lang} ...", $text); $lang_code = plgSystemEasyLanguage::getLagnCode(); $regex = "#{lang ".$lang_code."}(.*?){\/lang}#is"; $text = preg_replace($regex,'$1', $text); $regex = "#{lang [^}]+}.*?({\/lang}|\s\.\.\.)#is"; $text = preg_replace($regex,'', $text); //<Des>// Removal of the remaining redundant tags $sh_this = array("{lang ...","{/lang} ..."); $text = str_replace($sh_this, " ...", $text); return $text; } |
The administrator has disabled public write access.
The following user(s) said Thank You: Antonio
|
|
Thanks Des for your contribution, now we verify and will add it in the next release of Easy Language
|
If you like, if it was useful, consider a donation, Thanks
Se vuoi, se ti siamo stati utili, considera una donazione, Grazie Help us by voting our extensions on Joomla.org: JiFile JoomPhoto Mobile Easy Language
The administrator has disabled public write access.
|
If you not change browser settings, you agree to it. Learn more