-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
https://discuss.flarum.org/d/18316-flarum-seo/498
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;
}
To solve this, remove preg replace
file: /vendor/fof/upload/src/Adapters/Imgur.php
// successful upload, let's get the generated URL
if ($response->getStatusCode() == 200) {
$meta = Arr::get(json_decode($response->getBody(), true), 'data', []);
$link = Arr::get($meta, 'link');
$file->url = $link; //preg_replace('/^https?:/', null, $link);
$file->remote_id = Arr::get($meta, 'id');
}
Metadata
Metadata
Assignees
Labels
No labels
