mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 00:43:20 +01:00
merge forgotten function splithtmlbyPRE into 1.8. Was introduced accidentally by Ralf while merging in for rev34580: fixed not working deinstall of languages
This commit is contained in:
parent
2dc0739b2c
commit
415b492f18
@ -1491,5 +1491,31 @@ class html
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* split html by PRE tag, return array with all content pre-sections isolated in array elements
|
||||
* @author Leithoff, Klaus
|
||||
* @param string html
|
||||
* @return mixed array of parts or unaffected html
|
||||
*/
|
||||
static function splithtmlByPRE($html)
|
||||
{
|
||||
if (($pos = stripos($html,'<pre>')) === false)
|
||||
{
|
||||
return $html;
|
||||
}
|
||||
$html2ret[] = substr($html,0,$pos);
|
||||
while ($pos!==false)
|
||||
{
|
||||
$endofpre = stripos($html,'</pre>',$pos);
|
||||
$length = $endofpre-$pos+6;
|
||||
$html2ret[] = substr($html,$pos,$length);
|
||||
$pos = stripos($html,'<pre>', $endofpre+6);
|
||||
$html2ret[] = ($pos ? substr($html,$endofpre+6,$pos-($endofpre+6)): substr($html,$endofpre+6));
|
||||
//$pos=false;
|
||||
}
|
||||
return $html2ret;
|
||||
}
|
||||
|
||||
}
|
||||
html::_init_static();
|
||||
|
Loading…
Reference in New Issue
Block a user