', $data["type"]);
}
- }
- if (stripos($oembed, "
';
+ }
}
}
- return trim($data["text"] . ' ' . $text . ' ' . $data["after"]);
+
+ return trim($data["text"] . ' ' . $return . ' ' . $data["after"]);
}
function bb_remove_share_information($Text, $plaintext = false, $nolink = false) {
- $data = get_attachment_data($Text);
+ $data = BBCode::getAttachmentData($Text);
if (!$data) {
return $Text;
@@ -279,7 +285,7 @@ function bb_find_open_close($s, $open, $close, $occurence = 1) {
return false;
}
- $res = array( 'start' => $start_pos, 'end' => $end_pos );
+ $res = [ 'start' => $start_pos, 'end' => $end_pos ];
return $res;
}
@@ -315,16 +321,16 @@ function get_bb_tag_pos($s, $name, $occurence = 1) {
return false;
}
- $res = array(
- 'start' => array(
+ $res = [
+ 'start' => [
'open' => $start_open,
'close' => $start_close
- ),
- 'end' => array(
+ ],
+ 'end' => [
'open' => $end_open,
'close' => $end_open + strlen('[/' . $name . ']')
- ),
- );
+ ],
+ ];
if ($start_equal !== false) {
$res['start']['equal'] = $start_equal + 1;
@@ -359,7 +365,7 @@ function bb_tag_preg_replace($pattern, $replace, $name, $s) {
function bb_extract_images($body) {
- $saved_image = array();
+ $saved_image = [];
$orig_body = $body;
$new_body = '';
@@ -397,7 +403,7 @@ function bb_extract_images($body) {
$new_body = $new_body . $orig_body;
- return array('body' => $new_body, 'images' => $saved_image);
+ return ['body' => $new_body, 'images' => $saved_image];
}
function bb_replace_images($body, $images) {
@@ -409,7 +415,7 @@ function bb_replace_images($body, $images) {
// We're depending on the property of 'foreach' (specified on the PHP website) that
// it loops over the array starting from the first element and going sequentially
// to the last element
- $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '