X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fphotos.php;h=8f968d0c08d74f6f19eb142223cfb66d8137b3b0;hb=9c36b63b33b7bae4da27a5d6257df9e74cf7c5f2;hp=0107a179d059821de6689a63c4a7c0fa46ae50ab;hpb=9e9a104320b4f6a20743bd5bee3f61329a44d2ca;p=friendica.git diff --git a/mod/photos.php b/mod/photos.php index 0107a179d0..8f968d0c08 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -310,7 +310,7 @@ function photos_post(App $a) $desc = !empty($_POST['desc']) ? Strings::escapeTags(trim($_POST['desc'])) : ''; $rawtags = !empty($_POST['newtag']) ? Strings::escapeTags(trim($_POST['newtag'])) : ''; $item_id = !empty($_POST['item_id']) ? intval($_POST['item_id']) : 0; - $albname = !empty($_POST['albname']) ? Strings::escapeTags(trim($_POST['albname'])) : ''; + $albname = !empty($_POST['albname']) ? trim($_POST['albname']) : ''; $origaname = !empty($_POST['origaname']) ? Strings::escapeTags(trim($_POST['origaname'])) : ''; $aclFormatter = DI::aclFormatter(); @@ -425,13 +425,11 @@ function photos_post(App $a) $item = Item::selectFirst(['tag', 'inform', 'uri-id'], ['id' => $item_id, 'uid' => $page_owner_uid]); if (DBA::isResult($item)) { - $old_tag = $item['tag']; $old_inform = $item['inform']; } } if (strlen($rawtags)) { - $str_tags = ''; $inform = ''; // if the new tag doesn't have a namespace specifier (@foo or #foo) give it a hashtag @@ -513,15 +511,10 @@ function photos_post(App $a) if (!empty($contact)) { $taginfo[] = [$newname, $profile, $notify, $contact, '@[url=' . str_replace(',', '%2c', $profile) . ']' . $newname . '[/url]']; } else { - $taginfo[] = [$newname, $profile, $notify, null, $str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]']; - } - - if (strlen($str_tags)) { - $str_tags .= ','; + $taginfo[] = [$newname, $profile, $notify, null, '@[url=' . $profile . ']' . $newname . '[/url]']; } $profile = str_replace(',', '%2c', $profile); - $str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]'; if (!empty($item['uri-id'])) { Tag::store($item['uri-id'], Tag::MENTION, $newname, $profile); @@ -529,7 +522,6 @@ function photos_post(App $a) } } elseif (strpos($tag, '#') === 0) { $tagname = substr($tag, 1); - $str_tags .= '#[url=' . DI::baseUrl() . "/search?tag=" . $tagname . ']' . $tagname . '[/url],'; if (!empty($item['uri-id'])) { Tag::store($item['uri-id'], Tag::HASHTAG, $tagname); } @@ -537,19 +529,13 @@ function photos_post(App $a) } } - $newtag = $old_tag ?? ''; - if (strlen($newtag) && strlen($str_tags)) { - $newtag .= ','; - } - $newtag .= $str_tags; - $newinform = $old_inform ?? ''; if (strlen($newinform) && strlen($inform)) { $newinform .= ','; } $newinform .= $inform; - $fields = ['tag' => $newtag, 'inform' => $newinform, 'edited' => DateTimeFormat::utcNow(), 'changed' => DateTimeFormat::utcNow()]; + $fields = ['inform' => $newinform, 'edited' => DateTimeFormat::utcNow(), 'changed' => DateTimeFormat::utcNow()]; $condition = ['id' => $item_id]; Item::update($fields, $condition); @@ -623,10 +609,10 @@ function photos_post(App $a) Hook::callAll('photo_post_init', $_POST); // Determine the album to use - $album = !empty($_REQUEST['album']) ? Strings::escapeTags(trim($_REQUEST['album'])) : ''; - $newalbum = !empty($_REQUEST['newalbum']) ? Strings::escapeTags(trim($_REQUEST['newalbum'])) : ''; + $album = trim($_REQUEST['album'] ?? ''); + $newalbum = trim($_REQUEST['newalbum'] ?? ''); - Logger::log('mod/photos.php: photos_post(): album= ' . $album . ' newalbum= ' . $newalbum , Logger::DEBUG); + Logger::info('album= ' . $album . ' newalbum= ' . $newalbum); if (!strlen($album)) { if (strlen($newalbum)) {