]> git.mxchange.org Git - friendica.git/commitdiff
divide by zero on incorrectly specified oembed thumbnail size
authorfriendica <info@friendica.com>
Mon, 17 Dec 2012 01:58:12 +0000 (17:58 -0800)
committerfriendica <info@friendica.com>
Mon, 17 Dec 2012 01:58:12 +0000 (17:58 -0800)
boot.php
include/oembed.php
util/messages.po

index 2e1f47d74871d9b770807bd45e2147f299ef27fe..e69b59d707c1e7cf131df94ddb6a22c745eb8c40 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -12,7 +12,7 @@ require_once('library/Mobile_Detect/Mobile_Detect.php');
 require_once('include/features.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
-define ( 'FRIENDICA_VERSION',      '3.1.1556' );
+define ( 'FRIENDICA_VERSION',      '3.1.1559' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.23'    );
 define ( 'DB_UPDATE_VERSION',      1157      );
 
index dbb96a67ca7e5aa9f14e9bfa7299ff77bf650e37..bc127b5c3515f61cd061bcb63f9fa2710dc2f426 100755 (executable)
@@ -74,9 +74,10 @@ function oembed_format_object($j){
        switch ($j->type) {
                case "video": {
                        if (isset($j->thumbnail_url)) {
-                               $tw = (isset($j->thumbnail_width)) ? $j->thumbnail_width:200;
-                               $th = (isset($j->thumbnail_height)) ? $j->thumbnail_height:180;
-                               $tr = $tw/$th;
+                               $tw = (isset($j->thumbnail_width) && intval($j->thumbnail_width)) ? $j->thumbnail_width:200;
+                               $th = (isset($j->thumbnail_height) && intval($j->thumbnail_height)) ? $j->thumbnail_height:180;
+                               // make sure we don't attempt divide by zero, fallback is a 1:1 ratio
+                               $tr = (($th) ? $tw/$th : 1);
                                
                                $th=120; $tw = $th*$tr;
                                $tpl=get_markup_template('oembed_video.tpl');
index a663db090f774b80d3e159fa4e55af5f2f6cb4a5..b66db3e5555f4fe412f511a18ca711137abc324d 100644 (file)
@@ -6,9 +6,9 @@
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: 3.1.1556\n"
+"Project-Id-Version: 3.1.1559\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-12-13 10:00-0800\n"
+"POT-Creation-Date: 2012-12-16 10:00-0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -7836,12 +7836,12 @@ msgid "Set twitter search term"
 msgstr ""
 
 #: ../../view/theme/diabook/theme.php:629
-#: ../../view/theme/diabook/config.php:146 ../../include/acl_selectors.php:288
+#: ../../view/theme/diabook/config.php:146 ../../include/acl_selectors.php:313
 msgid "don't show"
 msgstr ""
 
 #: ../../view/theme/diabook/theme.php:629
-#: ../../view/theme/diabook/config.php:146 ../../include/acl_selectors.php:287
+#: ../../view/theme/diabook/config.php:146 ../../include/acl_selectors.php:312
 msgid "show"
 msgstr ""
 
@@ -9031,7 +9031,7 @@ msgstr ""
 msgid "[no subject]"
 msgstr ""
 
-#: ../../include/acl_selectors.php:286
+#: ../../include/acl_selectors.php:311
 msgid "Visible to everybody"
 msgstr ""