mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 01:35:12 +00:00
cleanup
This commit is contained in:
parent
4c18a11182
commit
eeec41258e
3 changed files with 11 additions and 12 deletions
|
@ -503,7 +503,7 @@ class ActivityStreams
|
|||
'application/ld+json;profile="https://www.w3.org/ns/activitystreams"',
|
||||
'application/activity+json',
|
||||
'application/ld+json;profile="http://www.w3.org/ns/activitystreams"',
|
||||
'application/ld+json', // required for Friendica ~2021-09, can possibly be removed after next release of that project
|
||||
'application/ld+json',
|
||||
'application/x-zot-activity+json'
|
||||
]);
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ require_once('include/photos.php');
|
|||
|
||||
/* @brief Initalize the cover-photo edit view
|
||||
*
|
||||
* @param $a Current application
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
|
@ -292,7 +291,7 @@ class Cover_photo extends Controller
|
|||
|
||||
$ptext = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . t('cover photo') . '[/zrl]';
|
||||
|
||||
$ltext = '[zrl=' . z_root() . '/profile/' . $channel['channel_address'] . ']' . '[zmg]' . z_root() . '/photo/' . $photo['resource_id'] . '-8[/zmg][/zrl]';
|
||||
$ltext = '[zrl=' . z_root() . '/profile/' . $channel['channel_address'] . ']' . '[zmg alt="' . t('cover photo') . '"]' . z_root() . '/photo/' . $photo['resource_id'] . '-8[/zmg][/zrl]';
|
||||
|
||||
$arr['body'] = sprintf($t, $channel['channel_name'], $ptext) . "\n\n" . $ltext;
|
||||
|
||||
|
|
|
@ -15,15 +15,15 @@ use Michelf\MarkdownExtra;
|
|||
require_once('include/event.php');
|
||||
require_once('include/html2plain.php');
|
||||
|
||||
function get_bb_tag_pos($s, $name, $occurance = 1)
|
||||
function get_bb_tag_pos($s, $name, $occurrence = 1)
|
||||
{
|
||||
|
||||
if ($occurance < 1) {
|
||||
$occurance = 1;
|
||||
if ($occurrence < 1) {
|
||||
$occurrence = 1;
|
||||
}
|
||||
|
||||
$start_open = -1;
|
||||
for ($i = 1; $i <= $occurance; $i++) {
|
||||
for ($i = 1; $i <= $occurrence; $i++) {
|
||||
if ($start_open !== false) {
|
||||
$start_open = strpos($s, '[' . $name, $start_open + 1); // allow [name= type tags
|
||||
}
|
||||
|
@ -62,9 +62,9 @@ function bb_tag_preg_replace($pattern, $replace, $name, $s)
|
|||
|
||||
$string = $s;
|
||||
|
||||
$occurance = 1;
|
||||
$pos = get_bb_tag_pos($string, $name, $occurance);
|
||||
while ($pos !== false && $occurance < 1000) {
|
||||
$occurrence = 1;
|
||||
$pos = get_bb_tag_pos($string, $name, $occurrence);
|
||||
while ($pos !== false && $occurrence < 1000) {
|
||||
$start = substr($string, 0, $pos['start']['open']);
|
||||
$subject = substr($string, $pos['start']['open'], $pos['end']['close'] - $pos['start']['open']);
|
||||
$end = substr($string, $pos['end']['close']);
|
||||
|
@ -75,8 +75,8 @@ function bb_tag_preg_replace($pattern, $replace, $name, $s)
|
|||
$subject = preg_replace($pattern, $replace, $subject);
|
||||
$string = $start . $subject . $end;
|
||||
|
||||
$occurance++;
|
||||
$pos = get_bb_tag_pos($string, $name, $occurance);
|
||||
$occurrence++;
|
||||
$pos = get_bb_tag_pos($string, $name, $occurrence);
|
||||
}
|
||||
|
||||
return $string;
|
||||
|
|
Loading…
Reference in a new issue