mirror of
https://github.com/friendica/friendica
synced 2025-04-28 23:04:24 +02:00
new password mail via notification()
new include/text.php::deindent() function remove unused templates
This commit is contained in:
parent
d85bdd8fb0
commit
9a0c37eb47
30 changed files with 64 additions and 566 deletions
|
@ -2229,3 +2229,22 @@ function is_a_date_arg($s) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* remove intentation from a text
|
||||
*/
|
||||
function deindent($text, $chr="[\t ]", $count=NULL) {
|
||||
$text = fix_mce_lf($text);
|
||||
$lines = explode("\n", $text);
|
||||
if (is_null($count)) {
|
||||
$m = array();
|
||||
$k=0; while($k<count($lines) && strlen($lines[$k])==0) $k++;
|
||||
preg_match("|^".$chr."*|", $lines[$k], $m);
|
||||
$count = strlen($m[0]);
|
||||
}
|
||||
for ($k=0; $k<count($lines); $k++){
|
||||
$lines[$k] = preg_replace("|^".$chr."{".$count."}|", "", $lines[$k]);
|
||||
}
|
||||
|
||||
return implode("\n", $lines);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue