]> git.mxchange.org Git - friendica.git/commitdiff
Remove unused BBCode::scaleExternalImage parameters
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 3 Jan 2020 01:44:15 +0000 (20:44 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 3 Jan 2020 01:44:15 +0000 (20:44 -0500)
- Remove now obsolete system.no_view_full_size config key

mod/item.php
src/Content/Text/BBCode.php
src/Content/Text/Markdown.php
static/defaults.config.php

index 52ccdb338ae4d5de0b186c372a5e27b99bd0e054..d6ce4a094436aabac6e1cc2904ee677c353777b2 100644 (file)
@@ -509,7 +509,7 @@ function item_post(App $a) {
        // Fold multi-line [code] sequences
        $body = preg_replace('/\[\/code\]\s*\[code\]/ism', "\n", $body);
 
-       $body = BBCode::scaleExternalImages($body, false);
+       $body = BBCode::scaleExternalImages($body);
 
        // Setting the object type if not defined before
        if (!$objecttype) {
index 4a2a75ece33d9004b1270a8ae21f5d52d017a941..fac2b83c17618aa01794e9b7520c425cd3c40cdf 100644 (file)
@@ -436,13 +436,8 @@ class BBCode
                }
        }
 
-       public static function scaleExternalImages($srctext, $include_link = true, $scale_replace = false)
+       public static function scaleExternalImages($srctext)
        {
-               // Suppress "view full size"
-               if (intval(Config::get('system', 'no_view_full_size'))) {
-                       $include_link = false;
-               }
-
                // Picture addresses can contain special characters
                $s = $srctext;
 
@@ -457,17 +452,7 @@ class BBCode
                                        continue;
                                }
 
-                               // $scale_replace, if passed, is an array of two elements. The
-                               // first is the name of the full-size image. The second is the
-                               // name of a remote, scaled-down version of the full size image.
-                               // This allows Friendica to display the smaller remote image if
-                               // one exists, while still linking to the full-size image
-                               if ($scale_replace) {
-                                       $scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[1]);
-                               } else {
-                                       $scaled = $mtch[1];
-                               }
-                               $i = Network::fetchUrl($scaled);
+                               $i = Network::fetchUrl($mtch[1]);
                                if (!$i) {
                                        return $srctext;
                                }
@@ -488,10 +473,8 @@ class BBCode
                                                        Logger::log('scale_external_images: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], Logger::DEBUG);
                                                        $s = str_replace(
                                                                $mtch[0],
-                                                               '[img=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/img]'
-                                                               . "\n" . (($include_link)
-                                                                       ? '[url=' . $mtch[1] . ']' . L10n::t('view full size') . '[/url]' . "\n"
-                                                                       : ''),
+                                                               '[img=' . $new_width . 'x' . $new_height. ']' . $mtch[1] . '[/img]'
+                                                               . "\n",
                                                                $s
                                                        );
                                                        Logger::log('scale_external_images: new string: ' . $s, Logger::DEBUG);
index 8d363675fc47ef9ae54bcaf254a5d86777c6a8f3..632282dff58b4ec71a183f2df0eb1f3146923fb3 100644 (file)
@@ -119,7 +119,7 @@ class Markdown
                $s = preg_replace('/(\[code\])+(.*?)(\[\/code\])+/ism', '[code]$2[/code]', $s);
 
                // Don't show link to full picture (until it is fixed)
-               $s = BBCode::scaleExternalImages($s, false);
+               $s = BBCode::scaleExternalImages($s);
 
                return $s;
        }
index e8211d597d713088cb3998cf51e60143b114c7d4..dfec158cfe15e8bfccf458aa3246fccb3877b960 100644 (file)
@@ -297,10 +297,6 @@ return [
                // Don't show smilies.
                'no_smilies' => false,
 
-               // no_view_full_size (Boolean)
-               // Don't add the link "View full size" under a resized image.
-               'no_view_full_size' => false,
-
                // optimize_items (Boolean)
                // Triggers an SQL command to optimize the item table before expiring items.
                'optimize_items' => false,