X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FModule%2FAdmin%2FItem%2FDelete.php;h=7afc3b09038e2c888d6d218fc183a6467a9993d1;hb=23b10cf2ae5fe10ba21a4b43e1aae17818647661;hp=424fef2b5233aab5c52fa25914a0b9bdf6250101;hpb=dad530802f2af7e3b522d59e73d547812169daf0;p=friendica.git diff --git a/src/Module/Admin/Item/Delete.php b/src/Module/Admin/Item/Delete.php index 424fef2b52..7afc3b0903 100644 --- a/src/Module/Admin/Item/Delete.php +++ b/src/Module/Admin/Item/Delete.php @@ -1,4 +1,23 @@ . + * + */ namespace Friendica\Module\Admin\Item; @@ -12,16 +31,16 @@ class Delete extends BaseAdmin { public static function post(array $parameters = []) { - parent::post($parameters); + self::checkAdminAccess(); if (empty($_POST['page_deleteitem_submit'])) { return; } - parent::checkFormSecurityTokenRedirectOnError('/admin/item/delete', 'admin_deleteitem'); + self::checkFormSecurityTokenRedirectOnError('/admin/item/delete', 'admin_deleteitem'); if (!empty($_POST['page_deleteitem_submit'])) { - $guid = trim(Strings::escapeTags($_POST['deleteitemguid'])); + $guid = trim($_POST['deleteitemguid']); // The GUID should not include a "/", so if there is one, we got an URL // and the last part of it is most likely the GUID. if (strpos($guid, '/')) { @@ -29,10 +48,10 @@ class Delete extends BaseAdmin } // Now that we have the GUID, drop those items, which will also delete the // associated threads. - Item::delete(['guid' => $guid]); + Item::markForDeletion(['guid' => $guid]); } - info(DI::l10n()->t('Item marked for deletion.') . EOL); + info(DI::l10n()->t('Item marked for deletion.')); DI::baseUrl()->redirect('admin/item/delete'); } @@ -48,8 +67,8 @@ class Delete extends BaseAdmin '$submit' => DI::l10n()->t('Delete this Item'), '$intro1' => DI::l10n()->t('On this page you can delete an item from your node. If the item is a top level posting, the entire thread will be deleted.'), '$intro2' => DI::l10n()->t('You need to know the GUID of the item. You can find it e.g. by looking at the display URL. The last part of http://example.com/display/123456 is the GUID, here 123456.'), - '$deleteitemguid' => ['deleteitemguid', DI::l10n()->t("GUID"), '', DI::l10n()->t("The GUID of the item you want to delete."), 'required', 'autofocus'], - '$form_security_token' => parent::getFormSecurityToken("admin_deleteitem") + '$deleteitemguid' => ['deleteitemguid', DI::l10n()->t("GUID"), '', DI::l10n()->t("The GUID of the item you want to delete."), DI::l10n()->t('Required'), 'autofocus'], + '$form_security_token' => self::getFormSecurityToken("admin_deleteitem") ]); } }