You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function setImageFromContent($content = null)
{
// Check post content is not empty
if($content !== null) {
// Read Post content and filter image url
$pattern = '/(?<=src=")((http.*?\.)(jpe?g|png|[tg]iff?|svg))(?=")/';
// Use image from post for social media og:image
if (preg_match_all($pattern, $content, $matches) && count($matches) > 0) {
$contentImage = $matches[0][0];
if ($contentImage !== null) {
$this->setImage($contentImage);
return $this;
}
}
}
return $this;
}
https://discuss.flarum.org/d/18316-flarum-seo/498
To solve this, remove preg replace
The text was updated successfully, but these errors were encountered: