|
|
@ -62,14 +62,18 @@ function prepareString($string, $large = false, $preview = false) { |
|
|
|
if(!in_array(substr($match[0], 0, 1), array('>', '"', '\''))) { |
|
|
|
$content = $match[0]; |
|
|
|
|
|
|
|
if($preview) { |
|
|
|
$embed = Embed\Embed::create($match[0]); |
|
|
|
if($embed->type == 'photo' |
|
|
|
&& $embed->images[0]['width'] <= 1024 |
|
|
|
&& $embed->images[0]['height'] <= 1024) { |
|
|
|
$content = '<img src="'.$match[0].'"/>'; |
|
|
|
} elseif($embed->type == 'link') { |
|
|
|
$content .= ' - '. $embed->title . ' - ' . $embed->providerName; |
|
|
|
if($preview) { |
|
|
|
try { |
|
|
|
$embed = Embed\Embed::create($match[0]); |
|
|
|
if($embed->type == 'photo' |
|
|
|
&& $embed->images[0]['width'] <= 1024 |
|
|
|
&& $embed->images[0]['height'] <= 1024) { |
|
|
|
$content = '<img src="'.$match[0].'"/>'; |
|
|
|
} elseif($embed->type == 'link') { |
|
|
|
$content .= ' - '. $embed->title . ' - ' . $embed->providerName; |
|
|
|
} |
|
|
|
} catch(Exception $e) { |
|
|
|
error_log($e->getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|