]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #7774 from annando/img-title
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 25 Oct 2019 23:29:55 +0000 (19:29 -0400)
committerGitHub <noreply@github.com>
Fri, 25 Oct 2019 23:29:55 +0000 (19:29 -0400)
Images: Show the description as title

1  2 
src/Content/Text/BBCode.php

index 11e7840b0a283e7237808ed0283f79fb4b7d7b4e,0dbac8b7710a4c10bd1148f2b611c241469b3731..8a029fe5344441dd4b6646ef1c81fb9993f10777
@@@ -24,7 -24,6 +24,7 @@@ use Friendica\Model\Event
  use Friendica\Model\Photo;
  use Friendica\Network\Probe;
  use Friendica\Object\Image;
 +use Friendica\Protocol\Activity;
  use Friendica\Util\Map;
  use Friendica\Util\Network;
  use Friendica\Util\ParseUrl;
@@@ -277,7 -276,7 +277,7 @@@ class BBCode extends BaseObjec
  
                        if (preg_match_all("(\[url=(.*?)\]\s*\[img\](.*?)\[\/img\]\s*\[\/url\])ism", $body, $pictures, PREG_SET_ORDER)) {
                                if ((count($pictures) == 1) && !$has_title) {
 -                                      if (!empty($item['object-type']) && ($item['object-type'] == ACTIVITY_OBJ_IMAGE)) {
 +                                      if (!empty($item['object-type']) && ($item['object-type'] == Activity\ObjectType::IMAGE)) {
                                                // Replace the preview picture with the real picture
                                                $url = str_replace('-1.', '-0.', $pictures[0][2]);
                                                $data = ['url' => $url, 'type' => 'photo'];
                        function ($matches) use ($simple_html) {
                                $matches[1] = self::proxyUrl($matches[1], $simple_html);
                                $matches[2] = htmlspecialchars($matches[2], ENT_COMPAT);
-                               return '<img src="' . $matches[1] . '" alt="' . $matches[2] . '">';
+                               return '<img src="' . $matches[1] . '" alt="' . $matches[2] . '" title="' . $matches[2] . '">';
                        },
                        $text);