Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 20. Jun 2018, 07:26

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: 28. Jun 2017, 06:59 
Offline
User avatar

Joined: 13. Apr 2015, 18:55
Posts: 50
Hai Michael,

Something strange is happening regarding parameter forwarding in https.
I use this shortcode to redirect the URL parameter '?page=' to the website's iFrame:

[advanced_iframe securitykey="mykey" use_shortcode_attributes_only="true" src="https://webshop-wordpress.broekmans.nl" width="100%" height="2000" scrolling="no" enable_ios_mobile_scrolling="true" id="EVWebshop" name="EVWebshop" url_forward_parameter="ALL" add_iframe_url_as_param_prefix="https://webshop-wordpress.broekmans.nl" onload_scroll_top="true" show_iframe_loader="true" enable_responsive_iframe="true" hide_page_until_loaded="false" resize_on_ajax_jquery="false" enable_external_height_workaround="true" map_parameter_to_url="page" use_post_message="true" ]

When using this shortcode with http, the URL 'http://broekmans.nl/webshop/?page=/assortiment/choco-presentje' would direct the iFrame in the page to the corresponding page: http://webshop-wordpress.broekmans.nl/assortiment/choco-presentje and worked correct and perfect. This URL shows a working site still running in http: http://www.bakkerijpot.nl/webshop/?page=/assortiment/vlaaien/appel-vlaai-27-cm-10-personen

Since a few days the site is running in https, so I changed the shortcode accordingly (added the -s and https://), but somehow the URL 'https://broekmans.nl/webshop/?page=/assortiment/choco-presentje' does not show the page in the iFrame but shows the message: Http iframes are not shown in https pages in many major browsers. Please read this post for details.. You can see it yourself by clicking the link.

But I do nothing with http, only https... Any clue why this message appears and how I can fix the parameter forward in https?

Regards, Marc

_________________
Greetings from sunny Curaçao!


Last edited by marcverkade on 4. Aug 2017, 18:59, edited 2 times in total.

Top
 Profile  
 
PostPosted: 28. Jun 2017, 07:06 
Offline
User avatar

Joined: 13. Apr 2015, 18:55
Posts: 50
I see this in the frame source: src='http://https://webshop-wordpress.broekmans.nl/assortiment/choco-presentje'
So something goes wrong when adding the parameter to the URL...
I guess you now have a clue what goes wrong ;-)

_________________
Greetings from sunny Curaçao!


Top
 Profile  
 
PostPosted: 28. Jun 2017, 07:30 
Offline
User avatar

Joined: 13. Apr 2015, 18:55
Posts: 50
Hai Michael,

I made a nasty workaround and removed the 'https://' i had added earlier to the shortcode parameter 'add_iframe_url_as_param_prefix' when it failed.
It now works but this is not a real solution I guess... So if you have a better solution, I really want to know.

BTW... No clue what I am doing, I am an ASP.Net guy ;-)

Changed http:// in https:// in the file advanced-iframe-main-prepare.php

Old code
if (!$this->ai_startsWith($src,"http")) {
if ($this->ai_startsWith($src,"s|")) {
$src = "https://" . $prefix . substr($src,2);
} else {
$src = "http://" . $prefix . $src;
}
}
New code
if (!$this->ai_startsWith($src,"http")) {
if ($this->ai_startsWith($src,"s|")) {
$src = "https://" . $prefix . substr($src,2);
} else {
$src = "https://" . $prefix . $src;
}
}

And in the file advanced-iframe-main-helper.php I replaced http:// with https:// too
$location = (@$_SERVER["HTTPS"] == "on") ? "https://" : "https://";

Regards, Marc

_________________
Greetings from sunny Curaçao!


Top
 Profile  
 
PostPosted: 28. Jun 2017, 07:42 
Offline
User avatar

Joined: 13. Apr 2015, 18:55
Posts: 50
Hmmm, does tis mean that I have to prefix the url with 's|'?
Let's wait what you have to say ;-)

_________________
Greetings from sunny Curaçao!


Top
 Profile  
 
PostPosted: 29. Jun 2017, 13:40 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10833
$location = (@$_SERVER["HTTPS"] == "on") ? "https://" : "https://";

should not be needed. What does your server return at $_SERVER["HTTPS"] ?

But I don't understand why your change should help! Because you only get to this part IF your url does NOT start with http

add_iframe_url_as_param_prefix="https://webshop-wordpress.broekmans.nl" is wrong! Please check the documentation:
With this setting you can define a prefix which all (most) of your pages in the iframe have. This prefix is than not added to the url but added internally. This does reduce the length of the parameter value. The prefix has to be without http:// or https://. So a prefix could be www.tinywebgallery.com/examples/.

Best, Michael


Top
 Profile  
 
PostPosted: 29. Jun 2017, 13:43 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10833
Maybe $_SERVER["HTTPS"] is the problem if your server does not set this to on but to a different value!

But this is only used if you use {href} in your code which is not the case...

and s| is something internal I use to keep the parameter short.

Best, Michael


Top
 Profile  
 
PostPosted: 2. Jul 2017, 22:18 
Offline
User avatar

Joined: 13. Apr 2015, 18:55
Posts: 50
Hai Michael,

You have misread my message:

Try 1: I replaced all http with https but left param_prefex to 'add_iframe_url_as_param_prefix="webshop-wordpress.broekmans.nl"'
Then the message: 'Http iframes are not shown in https pages in many major browsers. Please read this post for details' appeared

Try 2: I replaced the param_prefex to 'add_iframe_url_as_param_prefix="https://webshop-wordpress.broekmans.nl"'
Then nothing worked...

Try 3: I replaced the param_prefex to 'add_iframe_url_as_param_prefix="webshop-wordpress.broekmans.nl"'
And changed the code advanced-iframe-main-prepare.php with the workaround replcing http with https...

So any clue why Try 1 and Try 2 failed?
Regards, Marc

_________________
Greetings from sunny Curaçao!


Top
 Profile  
 
PostPosted: 3. Jul 2017, 22:32 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10833
I think $location = (@$_SERVER["HTTPS"] == "on") ? "https://" : "https://"; does not change anything....

Try 2 does not make sense but at try 1 I think your fix is adding the right "s" but I need to find out why it is not there as the other part with the s| should be used. I need to setup this scenario.....

Best, Michael


Top
 Profile  
 
PostPosted: 3. Jul 2017, 23:38 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10833
I think I know.

are you using old bookmarks like:
https://broekmans.nl/webshop/?page=/assortiment/choco-presentje%27 ?

Because for https the link should be
https://broekmans.nl/webshop/?page=s|/assortiment/choco-presentje%27

the s| I normally add by javascript. So if you need your old bookmarks working then
$src = "http://" . $prefix . $src;
->
$src = "https://" . $prefix . $src;

Is the way to go...

Best, Michael


Top
 Profile  
 
PostPosted: 4. Jul 2017, 13:13 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10833
for the next version I add an improvement here. If no s| is present I check the original iframe url if set. The one that is loaded when no page parameter does exist. And is this is https I do https - otherwise http then.

Best, Michael


Top
 Profile  
 
PostPosted: 9. Jul 2017, 01:52 
Offline
User avatar

Joined: 13. Apr 2015, 18:55
Posts: 50
That would be great...
IMHO it always should check if the base-url of the iFrame is https and set it accordingly...
I'll await the update and until then, make the dirty hack for every new site.
Regards, Marc

_________________
Greetings from sunny Curaçao!


Top
 Profile  
 
PostPosted: 9. Jul 2017, 23:05 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10833
Actually there is no dirty hack! You changed the protocol but you did not changed the links (added the s|).
My update is only a fallback because inside the iframe also a switch from http to https can happen.

:).

Best, Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
powered by phpbb | Datenschutz/ Privacy policy