From 10b453bfc28b8fec5f411072fdfe524aadf7fc29 Mon Sep 17 00:00:00 2001
From: Michael <heluecht@pirati.ca>
Date: Wed, 4 May 2022 07:49:37 +0000
Subject: [PATCH] Deprecated function removed

---
 src/Model/Item.php | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/src/Model/Item.php b/src/Model/Item.php
index 3ff7909aa1..d57700c33d 100644
--- a/src/Model/Item.php
+++ b/src/Model/Item.php
@@ -2709,7 +2709,7 @@ class Item
 	 * @throws \Friendica\Network\HTTPException\InternalServerErrorException
 	 * @todo Remove reference, simply return "rendered-html" and "rendered-hash"
 	 */
-	public static function putInCache(&$item)
+	private static function putInCache(&$item)
 	{
 		// Save original body to prevent addons to modify it
 		$body = $item['body'];
@@ -2722,8 +2722,6 @@ class Item
 			|| $rendered_hash != hash('md5', BBCode::VERSION . '::' . $body)
 			|| DI::config()->get('system', 'ignore_cache')
 		) {
-			self::addRedirToImageTags($item);
-
 			$item['rendered-html'] = BBCode::convertForUriId($item['uri-id'], $item['body']);
 			$item['rendered-hash'] = hash('md5', BBCode::VERSION . '::' . $body);
 
@@ -2748,31 +2746,6 @@ class Item
 		$item['body'] = $body;
 	}
 
-	/**
-	 * Find any non-embedded images in private items and add redir links to them
-	 *
-	 * @param array &$item The field array of an item row
-	 */
-	private static function addRedirToImageTags(array &$item)
-	{
-		$app = DI::app();
-
-		$matches = [];
-		$cnt = preg_match_all('|\[img\](http[^\[]*?/photo/[a-fA-F0-9]+?(-[0-9]\.[\w]+?)?)\[\/img\]|', $item['body'], $matches, PREG_SET_ORDER);
-		if ($cnt) {
-			foreach ($matches as $mtch) {
-				if (strpos($mtch[1], '/redir') !== false) {
-					continue;
-				}
-
-				if ((local_user() == $item['uid']) && ($item['private'] == self::PRIVATE) && ($item['contact-id'] != $app->getContactId()) && ($item['network'] == Protocol::DFRN)) {
-					$img_url = 'redir/' . $item['contact-id'] . '?url=' . urlencode($mtch[1]);
-					$item['body'] = str_replace($mtch[0], '[img]' . $img_url . '[/img]', $item['body']);
-				}
-			}
-		}
-	}
-
 	/**
 	 * Given an item array, convert the body element from bbcode to html and add smilie icons.
 	 * If attach is true, also add icons for item attachments.
-- 
2.39.5