By Peter on Friday, 21 March 2014
Posted in General
Replies 22
Likes 0
Views 1.4K
Votes 0
Link to vimeo and third party sites are broken

http://i.imgur.com/d9WMvCX.png

Many sites are starting to have default links as https like Vimeo and Google Play so those appear to be broken after upgrade from 1.1.6 to 1.2.2

I didn't get to test all links but have to assume it will be the same

How can this be addressed manually?
Hm, it looks like there's no real way to properly address this. Vimeo does not serve images from https but if you run your site with https and try to embed something that is not https, it will also cause the padlocks to not appear. I guess you need to choose either one or setup a proper https proxy server. At the moment, what you can do to fix this is to edit the file /apps/user/links/links.php and at line 360 onwards, remove the codes below:


// If necessary, replace http:// with https://
if ($oembed && $uri->getScheme() == 'https') {
// Try to replace http:// with https://
$oembed->html = str_ireplace( 'http://', 'https://' , $oembed->html );
$oembed->thumbnail = str_ireplace( 'http://', 'https://' , $oembed->thumbnail );
}
·
Friday, 21 March 2014 15:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

Sorry I haven't had the time to test. Before I go ahead with any changes can you also look into this link
https://play.google.com/store/music/album/Skrillex_Recess?id=Bj4tah2ujkiorhdiai3se2pi6yq

This link works on 1.1.6 but shows as broken after upgrading to 1.2.3
·
Tuesday, 25 March 2014 13:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Peter,

The reason it worked in 1.1.6 because this version do not have the block of code mention by Mark. We added these code in version 1.2.x. So for the current workaround, you will need to edit the file and remove the code mentioned in Mark reply

Hope this help and have a nice day
Sam
·
Tuesday, 25 March 2014 13:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Sam

I tweaked the social_stream_assets table to make the URL as relative and it works much better

this --> //play.google.com/store/music/album/Skrillex_Recess?id=Bj4tah2ujkiorhdiai3se2pi6yq
instead of --> https:// play.google.com/store/music/album/Skrillex_Recess?id=Bj4tah2ujkiorhdiai3se2pi6yq

Is there any way to edit the code to accept this?

I tried this but it doesn't work:

		// If necessary, replace http:// with https://
if ($oembed && $uri->getScheme() == 'https') {
// Try to replace http:// with https://
$oembed->html = str_ireplace( 'http://', '//' , $oembed->html );
$oembed->thumbnail = str_ireplace( 'http://', '//' , $oembed->thumbnail );
}
·
Tuesday, 25 March 2014 13:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Peter,

Try these code instead :



if ($oembed && $uri->getScheme() == 'https') {
// Try to replace http:// with https://
$oembed->html = str_ireplace( 'https://', '//' , $oembed->html );
$oembed->thumbnail = str_ireplace( 'https://', '//' , $oembed->thumbnail );
}



In your previous example, you are searching 'http' instead of 'https'

Let me know if the above work for you or not
Sam
·
Tuesday, 25 March 2014 14:01
·
0 Likes
·
0 Votes
·
0 Comments
·
For some reason, that doesn't work either.

It only works if I go through phpmyadmin and replaced it manually.

Looking at the color for the code, it seems to think it is a comment. Could that be the issue?
·
Tuesday, 25 March 2014 14:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Peter,

I tried to access the link that you have provided but Google Play seems to be returning me this error,


Sorry! Music on Google Play is not available in your country yet.
We're working to bring the content you love to more countries as quickly as possible.
Please check back again soon.


Any ideas? The code that Sam provided should work fine as it looks like it's a comment because the syntax highlighter isn't able to detect it correctly.
·
Tuesday, 25 March 2014 18:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Peter,

Em, regarding your issue, I followed the suggestion from Mark by comment out the below code from file 'JOOMLA/media/com_easysocial/apps/user/links/links.php' at line 360 ~ 364 and now the links seem working correctly.

screencast.com/t/xRjOpSwls

Please advise.

Hope this help and have a nice day
Sam
·
Tuesday, 25 March 2014 19:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Since ES has the code there for a reason, any problems you can think of for sites running only using https ?
·
Wednesday, 26 March 2014 10:59
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Peter,

That particular code is only to fix links that are shared using non https because if some of the assets like images, videos that are shared on http, it will cause the padlock on the address bar to be broken. There's only 1 best solution for this is to setup a proxy to proxy off non https contents but this is a pretty tricky setup.

The best bet is to not have any url sharing if you are on https mode because there's no real way to detect whether that URL supports https:// or not. For instance, if you try to share a vimeo link, it does not support https
·
Wednesday, 26 March 2014 11:50
·
0 Likes
·
0 Votes
·
0 Comments
·
I thought that was what you meant so that was the reason I decided to modify it to look for relative URL instead of removing it completely.

I'll test some more. Thank you both for assisting.
·
Wednesday, 26 March 2014 12:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Peter,

Regardless if you are using https:// or // , it will lead to the same issues
·
Wednesday, 26 March 2014 12:19
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm revisiting this because it's not clear to me.

Here is the current test:

View site as https:
Post https link in dashboard it appears broken

View site as http:
both the link and image shows https URL

So why wouldn't it work since it is not mixed content? Just to confirm, I looked under stream assets and both URLs are indeed https
·
Friday, 04 April 2014 03:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Peter,

What is the exact link that you tried to post? I need to reproduce this on your site.
·
Friday, 04 April 2014 13:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Peter,

The login is not functional
·
Friday, 04 April 2014 14:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry Mark, I added the details again. Maybe a typo.
·
Friday, 04 April 2014 15:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, yeah you are right. For some reason it's being treated as a video. I can't debug this locally because for some odd reasons, Google Store is blocking my access to this page This is what I get when posting locally, http://screencast.com/t/ROUUB3iqchrN


Is it possible that you provide us with the FTP access?
·
Friday, 04 April 2014 16:44
·
0 Likes
·
0 Votes
·
0 Comments
·
It's possible Google blocked some of the content due to licensing agreement in your area? Or it could be that the content is only available for certain locale? I'm not sure. Are you able to see anything from play.google.com?
·
Friday, 04 April 2014 20:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Peter,

Okay, I believe that the problem is because Google Play Music doesn't allow rendering of the image on https . I need to remove the hacks in the file /media/com_easysocial/apps/user/links/links.php at line 361 below,


if ($oembed && $uri->getScheme() == 'https') {
// Try to replace http:// with https://
// $oembed->html = str_ireplace( 'http://', 'https://' , $oembed->html );
// $oembed->thumbnail = str_ireplace( 'http://', 'https://' , $oembed->thumbnail );
}


I guess there's actually no real way to enforce everything to be https because of issues like this. The originating site item doesn't support https
·
Saturday, 05 April 2014 01:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

I am so confused now and maybe I need sleep.

if ES site is https enabled and user submit https dashboard link post and the fetched image is also https
--shouldn't ES check and simply leave this scenario alone without making changes?

Since relative URL serves both http and https - how difficult would it be to make ES serve dashboard posts with that instead? So far, it works majority of the time via backend manual edit (would prefer automatation) and I'll take my chances since most major sites now support https. Perhaps a side download patch for those that are using https?
·
Saturday, 05 April 2014 05:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Peter,

No, even though the "link" is https, the assets / data that is rendered on the page might not be on https. For instance, if I am sharing a https link but in the og:image I am using a "http://" link for the image. It will cause the padlock on your site to be broken. Hence, we added a hack to modify every link that is output on your site to be https when your site is running on https

The problem only occurs when the target image that doesn't support access over https .
·
Saturday, 05 April 2014 15:36
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post