Portnumber in HTTPS-URL on 'Save' in Admin

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
tvloeimans
Posts: 20
Joined: 2019-03-20 13:46

Portnumber in HTTPS-URL on 'Save' in Admin

Post by tvloeimans » 2019-04-09 21:27

Hi,

I am having the problem when I edit something in the admin. When 'Save changes' is clicked in the Admin, I get a error because the portnumber is in the URL. The happens with the Member and Group Edit pages.

Code: Select all

https://myURL.nl:80/app/admin/pageEditGroup.php?groupID=3
https://myURL.nl:80/app/admin/pageEditMember.php?saved=1&memberID=admin
I've tested this only in HTTPS, I did not tested this on normal HTTP.

Anyone known with this issue, and someone with a work around?

Thanks,
Tim
©2019 - No rights reserved

tvloeimans
Posts: 20
Joined: 2019-03-20 13:46

Re: Portnumber in HTTPS-URL on 'Save' in Admin

Post by tvloeimans » 2019-05-06 15:40

anyone?
This is starting to get quite a problem for us.
©2019 - No rights reserved

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 292
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Portnumber in HTTPS-URL on 'Save' in Admin

Post by jsetzer » 2019-05-07 12:16

Never seen this in my AppGini environments before. :shock:
  • Can you please tell me which port you are using (if not 80).
Does this only happen when you start the app from...

Code: Select all

https://myURL.nl:80/ 
or does this even happen when you start from

Code: Select all

https://myURL.nl/
If second, you will need to find out when and where the port number is being appended to the server address:
  • You should search your whole code for ":80" in your code-editor. In my case there is no match which is fine.
  • Maybe there is some unnecessary or wrong routing in .htaccess file?
  • The action-attribute of the pageEditGroup-form does not have any server or port, just the filename:

    Code: Select all

    <form method="post" action="pageEditGroup.php" ...>
    
    So the SaveChanges button will submit (POST) data to the current server-address+"pageEditGroup.php". That's why I guess,the server address is already wrong when you enter pageEditGroup.php.
Usually there is no need to append port number 80 because this is browser's default for HTTP and HTTPS.

Hope this helps!
Jan

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 659
Joined: 2018-04-01 10:12

Re: Portnumber in HTTPS-URL on 'Save' in Admin

Post by pböttcher » 2019-07-05 10:09

Hi,

this seems to be a bug when using alternative ports.

I have an environment where I set the port to 8765.

So calling the url http://localhost:8765/dd
works fine and gets me to the login screen. After entering the credentials I get an redirect error.

After looking into the issue I see that in the function application_url (in admin/incFunctions)
the creation of the url is put together wrong.

I have in my environment the $_SERVER as:

[HTTP_HOST] => localhost:8765
[SERVER_NAME] => localhost
[SERVER_ADDR] => ::1
[SERVER_PORT] => 8765
[REMOTE_ADDR] => ::1

The function is creating out of this information the url:

http://localhost:8765:8765/dd/index.php

this happens to my opinion because the HTTP_HOST is used to create the URL, by appending the port. But the port is already there.

$host = (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : $s['SERVER_NAME']) . $port;

adds the port to the already exising port extension.

Please have a look at this.

Post Reply