mirror of
https://github.com/friendica/friendica
synced 2025-04-26 17:10:10 +00:00
more spaces + some curly spaces added
Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
parent
41a36606c6
commit
951006dd10
42 changed files with 206 additions and 187 deletions
|
@ -206,10 +206,10 @@ function bb_spacefy($st) {
|
|||
// returning [i]italic[/i]
|
||||
|
||||
function bb_unspacefy_and_trim($st) {
|
||||
$whole_match = $st[0];
|
||||
$captured = $st[1];
|
||||
$unspacefied = preg_replace("/\[ (.*?)\ ]/", "[$1]", $captured);
|
||||
return $unspacefied;
|
||||
$whole_match = $st[0];
|
||||
$captured = $st[1];
|
||||
$unspacefied = preg_replace("/\[ (.*?)\ ]/", "[$1]", $captured);
|
||||
return $unspacefied;
|
||||
}
|
||||
|
||||
function bb_find_open_close($s, $open, $close, $occurance = 1) {
|
||||
|
@ -218,18 +218,21 @@ function bb_find_open_close($s, $open, $close, $occurance = 1) {
|
|||
$occurance = 1;
|
||||
|
||||
$start_pos = -1;
|
||||
for($i = 1; $i <= $occurance; $i++) {
|
||||
if ( $start_pos !== false)
|
||||
for ($i = 1; $i <= $occurance; $i++) {
|
||||
if ( $start_pos !== false) {
|
||||
$start_pos = strpos($s, $open, $start_pos + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ( $start_pos === false)
|
||||
if ( $start_pos === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$end_pos = strpos($s, $close, $start_pos);
|
||||
|
||||
if ( $end_pos === false)
|
||||
if ( $end_pos === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$res = array( 'start' => $start_pos, 'end' => $end_pos );
|
||||
|
||||
|
@ -242,9 +245,10 @@ function get_bb_tag_pos($s, $name, $occurance = 1) {
|
|||
$occurance = 1;
|
||||
|
||||
$start_open = -1;
|
||||
for($i = 1; $i <= $occurance; $i++) {
|
||||
if ( $start_open !== false)
|
||||
for ($i = 1; $i <= $occurance; $i++) {
|
||||
if ( $start_open !== false) {
|
||||
$start_open = strpos($s, '[' . $name, $start_open + 1); // allow [name= type tags
|
||||
}
|
||||
}
|
||||
|
||||
if ( $start_open === false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue