Piwigo / piwigo-openstreetmap

OpenStreetMap integration for Piwigo
http://piwigo.org/ext/extension_view.php?eid=701
GNU General Public License v3.0
35 stars 35 forks source link

wrong picture URL when using secured connection (https) #106

Open croulibri opened 8 years ago

croulibri commented 8 years ago

Hi, I am using piwigo-openstreetmap plugin with Piwigo 2.8.1.

I noticed that the plugin is not working properly when I set $conf['question_mark_in_urls'] = false; in local FileEditor. In that case, the map can't display either the number of pictures (with green/yellow/pink markers) or the thumbnail.

In addition if I am over https (with "Force HTTPS plugin) I still can't see the thumbnail and the link to the picture is not working. Indeed instead of : https://www.XXXXXX.sr/photos/picture.php?/7784/category the plugin send to https://www.XXXXXX.sr:80/photos/picture.php?/7784/category (adding the :80 to the URL)

If I remove $conf['question_mark_in_urls'] = false; in local FileEditor and Force HTTPS plugin, when looking at the map with http only, then everything works fine.

Is it a problem of htaccess ? something else ? My htaccess only include : RewriteEngine on RewriteBase /

Or it is an issue of piwigo-openstreetmap?

croulibri commented 8 years ago

I am daring adding a comment to my previous post... Indeed, on my Piwigo config, all URLs of the pictures is incorrect when using Piwigo over secured connection (https). Is it the same for you ? So I can't preview them on the map and the picture link to the Galery isn't working. Is it the same for you ?

xbgmsharp commented 8 years ago

HTTPS is working with the plugin and PWG. However I do think there is issue using $conf['question_mark_in_urls'] = false; I will check it again but according to #4 it should be working. I will see if I can reproduce the issue.

croulibri commented 8 years ago

Yes, I need to deactivate $conf['question_mark_in_urls'] and put false to make it works. The plugin works, it can access to data of pictures and put them in correct location with correct name.

When I click to "map" in order to see all my pictures in a worldmap, I see all the mark well located, the name of pictures... However the thumbnail and the link to the page of the picture are not working because piwigo-openstreetmap adds :80 to the URL. Is it possible to deactivate the addition of this :80 in the URL (see my first post) ?

Following your previous message, I have no problem with the editing part as suggested by ghost. In administration section, when I want to edit a pictures, the openstreetmap tabs works and I can select a location.

croulibri commented 7 years ago

I finally found the problem that brings the addition of :80 in https URL and the thumbnails not to work.

The explanation and answer was given by Samih at http://piwigo.org/forum/viewtopic.php?pid=166672#p166672

His proposed solution is : " First of all, if trying this method, make backup of at least your original functions_url.inc.php.

What i did, was i commented out the part of function which does the port finding routine, resulting in following lines in functions_url.inc.php file (lines 70-81):

Code:

     {
      $url .= $_SERVER['HTTP_HOST']; 
//      if ( (!$is_https && $_SERVER['SERVER_PORT'] != 80)
//            ||($is_https && $_SERVER['SERVER_PORT'] != 443))
//      {
//        $url_port = ':'.$_SERVER['SERVER_PORT'];
//        if (strrchr($url, ':') != $url_port)
//        {
//          $url .= $url_port;
//        }
//      }
    }

Use your favourite text editor to comment out lines with two slashes in the beginning of each line as in code sample above. If something breaks revert to backed up file. I'm not a coder so this is not very elegant solution but it worked for me. "

austin3410 commented 1 year ago

I finally found the problem that brings the addition of :80 in https URL and the thumbnails not to work.

The explanation and answer was given by Samih at http://piwigo.org/forum/viewtopic.php?pid=166672#p166672

His proposed solution is : " First of all, if trying this method, make backup of at least your original functions_url.inc.php.

What i did, was i commented out the part of function which does the port finding routine, resulting in following lines in functions_url.inc.php file (lines 70-81):

Code:

     {
      $url .= $_SERVER['HTTP_HOST']; 
//      if ( (!$is_https && $_SERVER['SERVER_PORT'] != 80)
//            ||($is_https && $_SERVER['SERVER_PORT'] != 443))
//      {
//        $url_port = ':'.$_SERVER['SERVER_PORT'];
//        if (strrchr($url, ':') != $url_port)
//        {
//          $url .= $url_port;
//        }
//      }
    }

Use your favourite text editor to comment out lines with two slashes in the beginning of each line as in code sample above. If something breaks revert to backed up file. I'm not a coder so this is not very elegant solution but it worked for me. "

This worked for me!!! Thankyou so MUCH!!!