From 98fd919647a0eb86131eb3863719dfd75ec700a7 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 29 Oct 2015 11:30:45 +0100 Subject: possibly better fix for profile photo image type issue --- include/photo/photo_driver.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index bbcc110c8..11e4c8af3 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -593,15 +593,24 @@ function import_profile_photo($photo,$xchan,$thing = false) { if($photo) { $filename = basename($photo); - $type = guess_image_type($photo); - - if(! $type) - $type = 'image/jpeg'; $result = z_fetch_url($photo,true); - if($result['success']) + if($result['success']) { $img_str = $result['body']; + + $h = explode("\n",$result['header']); + if($h) { + foreach($h as $hl) { + if(stristr($hl,'content-type:')) { + if(! stristr($hl,'image/')) { + $photo_failure = true; + } + } + } + } + $type = guess_image_type($photo, $result['header']); + } } $img = photo_factory($img_str, $type); -- cgit v1.2.3 From 3e459ed4345e9e19db92856e78b9bf4ebbd6ffdd Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 29 Oct 2015 11:34:56 +0100 Subject: move it up --- include/photo/photo_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 11e4c8af3..96bde7587 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -598,6 +598,7 @@ function import_profile_photo($photo,$xchan,$thing = false) { if($result['success']) { $img_str = $result['body']; + $type = guess_image_type($photo, $result['header']); $h = explode("\n",$result['header']); if($h) { @@ -609,7 +610,6 @@ function import_profile_photo($photo,$xchan,$thing = false) { } } } - $type = guess_image_type($photo, $result['header']); } } -- cgit v1.2.3 From 52120b367ab99d1f7a96aa9e3a1f5ef5176a1ce5 Mon Sep 17 00:00:00 2001 From: jeroenpraat Date: Sat, 31 Oct 2015 21:07:57 +0100 Subject: Update nl+es --- view/es/messages.po | 8 ++++++-- view/es/strings.php | 1 + view/nl/messages.po | 8 ++++++-- view/nl/strings.php | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/view/es/messages.po b/view/es/messages.po index 6c2093830..4ed1d6c44 100644 --- a/view/es/messages.po +++ b/view/es/messages.po @@ -13,8 +13,8 @@ msgid "" msgstr "" "Project-Id-Version: Redmatrix\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-17 16:47-0700\n" -"PO-Revision-Date: 2015-10-18 15:17+0000\n" +"POT-Creation-Date: 2015-10-23 00:04-0700\n" +"PO-Revision-Date: 2015-10-31 19:26+0000\n" "Last-Translator: Manuel Jiménez Friaza \n" "Language-Team: Spanish (http://www.transifex.com/Friendica/red-matrix/language/es/)\n" "MIME-Version: 1.0\n" @@ -4530,6 +4530,10 @@ msgstr "Normas de Registro" msgid "Location" msgstr "Localización" +#: ../../mod/pubsites.php:26 +msgid "Project" +msgstr "Proyecto" + #: ../../mod/pubsites.php:26 msgid "View hub ratings" msgstr "Ver las valoraciones del sitio" diff --git a/view/es/strings.php b/view/es/strings.php index 8b0b1758a..be750b0ff 100644 --- a/view/es/strings.php +++ b/view/es/strings.php @@ -1067,6 +1067,7 @@ $a->strings["Site URL"] = "Dirección del sitio"; $a->strings["Access Type"] = "Tipo de Acceso"; $a->strings["Registration Policy"] = "Normas de Registro"; $a->strings["Location"] = "Localización"; +$a->strings["Project"] = "Proyecto"; $a->strings["View hub ratings"] = "Ver las valoraciones del sitio"; $a->strings["Rate"] = "Valorar"; $a->strings["View ratings"] = "Ver valoraciones"; diff --git a/view/nl/messages.po b/view/nl/messages.po index 0b3d7e3fd..6f55daf17 100644 --- a/view/nl/messages.po +++ b/view/nl/messages.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: Redmatrix\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-17 16:47-0700\n" -"PO-Revision-Date: 2015-10-18 13:28+0000\n" +"POT-Creation-Date: 2015-10-23 00:04-0700\n" +"PO-Revision-Date: 2015-10-26 15:27+0000\n" "Last-Translator: jeroenpraat \n" "Language-Team: Dutch (http://www.transifex.com/Friendica/red-matrix/language/nl/)\n" "MIME-Version: 1.0\n" @@ -4526,6 +4526,10 @@ msgstr "Registratiebeleid" msgid "Location" msgstr "Locatie" +#: ../../mod/pubsites.php:26 +msgid "Project" +msgstr "Project" + #: ../../mod/pubsites.php:26 msgid "View hub ratings" msgstr "Bekijk hubbeoordelingen" diff --git a/view/nl/strings.php b/view/nl/strings.php index 865de908e..295164d17 100644 --- a/view/nl/strings.php +++ b/view/nl/strings.php @@ -1067,6 +1067,7 @@ $a->strings["Site URL"] = "URL hub"; $a->strings["Access Type"] = "Toegangstype"; $a->strings["Registration Policy"] = "Registratiebeleid"; $a->strings["Location"] = "Locatie"; +$a->strings["Project"] = "Project"; $a->strings["View hub ratings"] = "Bekijk hubbeoordelingen"; $a->strings["Rate"] = "Beoordeel"; $a->strings["View ratings"] = "Bekijk beoordelingen"; -- cgit v1.2.3