Changed:
- empty() is maybe superflous here, still I would prefer a code style that is written explicitly and not rely on "magic casting"
This commit is contained in:
parent
15d8341d9a
commit
7eefb9aed8
4 changed files with 7 additions and 7 deletions
|
@ -111,7 +111,7 @@ class BBCode
|
||||||
|
|
||||||
$picturedata = Images::getInfoFromURLCached($matches[1]);
|
$picturedata = Images::getInfoFromURLCached($matches[1]);
|
||||||
|
|
||||||
if (!empty($picturedata)) {
|
if ($picturedata) {
|
||||||
if (($picturedata[0] >= 500) && ($picturedata[0] >= $picturedata[1])) {
|
if (($picturedata[0] >= 500) && ($picturedata[0] >= $picturedata[1])) {
|
||||||
$post['image'] = $matches[1];
|
$post['image'] = $matches[1];
|
||||||
} else {
|
} else {
|
||||||
|
@ -320,7 +320,7 @@ class BBCode
|
||||||
$post['text'] = trim(str_replace($pictures[0][0], '', $body));
|
$post['text'] = trim(str_replace($pictures[0][0], '', $body));
|
||||||
} else {
|
} else {
|
||||||
$imgdata = Images::getInfoFromURLCached($pictures[0][1]);
|
$imgdata = Images::getInfoFromURLCached($pictures[0][1]);
|
||||||
if (!empty($imgdata) && substr($imgdata['mime'], 0, 6) == 'image/') {
|
if (($imgdata) && substr($imgdata['mime'], 0, 6) == 'image/') {
|
||||||
$post['type'] = 'photo';
|
$post['type'] = 'photo';
|
||||||
$post['image'] = $pictures[0][1];
|
$post['image'] = $pictures[0][1];
|
||||||
$post['preview'] = $pictures[0][2];
|
$post['preview'] = $pictures[0][2];
|
||||||
|
|
|
@ -192,7 +192,7 @@ class Media
|
||||||
|
|
||||||
if (($media['type'] == self::IMAGE) || ($filetype == 'image')) {
|
if (($media['type'] == self::IMAGE) || ($filetype == 'image')) {
|
||||||
$imagedata = Images::getInfoFromURLCached($media['url']);
|
$imagedata = Images::getInfoFromURLCached($media['url']);
|
||||||
if (!empty($imagedata)) {
|
if ($imagedata) {
|
||||||
$media['mimetype'] = $imagedata['mime'];
|
$media['mimetype'] = $imagedata['mime'];
|
||||||
$media['size'] = $imagedata['size'];
|
$media['size'] = $imagedata['size'];
|
||||||
$media['width'] = $imagedata[0];
|
$media['width'] = $imagedata[0];
|
||||||
|
@ -202,7 +202,7 @@ class Media
|
||||||
}
|
}
|
||||||
if (!empty($media['preview'])) {
|
if (!empty($media['preview'])) {
|
||||||
$imagedata = Images::getInfoFromURLCached($media['preview']);
|
$imagedata = Images::getInfoFromURLCached($media['preview']);
|
||||||
if (!empty($imagedata)) {
|
if ($imagedata) {
|
||||||
$media['preview-width'] = $imagedata[0];
|
$media['preview-width'] = $imagedata[0];
|
||||||
$media['preview-height'] = $imagedata[1];
|
$media['preview-height'] = $imagedata[1];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1377,7 +1377,7 @@ class OStatus
|
||||||
case 'photo':
|
case 'photo':
|
||||||
if (!empty($siteinfo['image'])) {
|
if (!empty($siteinfo['image'])) {
|
||||||
$imgdata = Images::getInfoFromURLCached($siteinfo['image']);
|
$imgdata = Images::getInfoFromURLCached($siteinfo['image']);
|
||||||
if (!empty($imgdata)) {
|
if ($imgdata) {
|
||||||
$attributes = [
|
$attributes = [
|
||||||
'rel' => 'enclosure',
|
'rel' => 'enclosure',
|
||||||
'href' => $siteinfo['image'],
|
'href' => $siteinfo['image'],
|
||||||
|
@ -1407,7 +1407,7 @@ class OStatus
|
||||||
|
|
||||||
if (!DI::config()->get('system', 'ostatus_not_attach_preview') && ($siteinfo['type'] != 'photo') && isset($siteinfo['image'])) {
|
if (!DI::config()->get('system', 'ostatus_not_attach_preview') && ($siteinfo['type'] != 'photo') && isset($siteinfo['image'])) {
|
||||||
$imgdata = Images::getInfoFromURLCached($siteinfo['image']);
|
$imgdata = Images::getInfoFromURLCached($siteinfo['image']);
|
||||||
if (!empty($imgdata)) {
|
if ($imgdata) {
|
||||||
$attributes = [
|
$attributes = [
|
||||||
'rel' => 'enclosure',
|
'rel' => 'enclosure',
|
||||||
'href' => $siteinfo['image'],
|
'href' => $siteinfo['image'],
|
||||||
|
|
|
@ -551,7 +551,7 @@ class ParseUrl
|
||||||
if (!empty($image['url'])) {
|
if (!empty($image['url'])) {
|
||||||
$image['url'] = self::completeUrl($image['url'], $page_url);
|
$image['url'] = self::completeUrl($image['url'], $page_url);
|
||||||
$photodata = Images::getInfoFromURLCached($image['url']);
|
$photodata = Images::getInfoFromURLCached($image['url']);
|
||||||
if (!empty($photodata) && ($photodata[0] > 50) && ($photodata[1] > 50)) {
|
if (($photodata) && ($photodata[0] > 50) && ($photodata[1] > 50)) {
|
||||||
$image['src'] = $image['url'];
|
$image['src'] = $image['url'];
|
||||||
$image['width'] = $photodata[0];
|
$image['width'] = $photodata[0];
|
||||||
$image['height'] = $photodata[1];
|
$image['height'] = $photodata[1];
|
||||||
|
|
Loading…
Reference in a new issue