mirror of
https://github.com/friendica/friendica
synced 2024-11-18 17:03:41 +00:00
Merge pull request #8532 from annando/fix-image-description
Fix: Image descriptions now work again
This commit is contained in:
commit
36717a9953
1 changed files with 9 additions and 2 deletions
|
@ -449,13 +449,20 @@ class BBCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function scaleExternalImages($srctext)
|
/**
|
||||||
|
* This function changing the visual size (not the real size) of images.
|
||||||
|
* The function does not work for pictures with an alternate text description.
|
||||||
|
* This could only be changed by using some new "img" BBCode format.
|
||||||
|
*
|
||||||
|
* @param string $srctext The body with images
|
||||||
|
* @return string The body with possibly scaled images
|
||||||
|
*/
|
||||||
|
public static function scaleExternalImages(string $srctext)
|
||||||
{
|
{
|
||||||
$s = $srctext;
|
$s = $srctext;
|
||||||
|
|
||||||
// Simplify image links
|
// Simplify image links
|
||||||
$s = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $s);
|
$s = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $s);
|
||||||
$s = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/ism", '[img]$1[/img]', $s);
|
|
||||||
|
|
||||||
$matches = null;
|
$matches = null;
|
||||||
$c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism', $s, $matches, PREG_SET_ORDER);
|
$c = preg_match_all('/\[img.*?\](.*?)\[\/img\]/ism', $s, $matches, PREG_SET_ORDER);
|
||||||
|
|
Loading…
Reference in a new issue