#287 - Error after SSL/TLS (HTTPS) Configuration from an https site
| Identifier | #287 |
|---|---|
| Issue type | Major issue (breaks an entire feature) |
| Title | Error after SSL/TLS (HTTPS) Configuration from an https site |
| Status | Completed |
| Handling member | Chris Graham |
| Addon | core |
| Description | I got this error twice on two separate installations of Composr 7.1.5. What I did was to configure my site name under rebranding as https://nameofmysite.com/portal and turning on https authentication under Configuration->Security and after turning on SSL/TLS (HTTPS) Configuration under Security menu.
the error below shows: PHP WARNING [2] parse_url(https:///nameofmysite.com/portal) [<a href='http://www.php.net/manual/en/function.parse-url.php'>function.parse-url.php</a>]: Unable to parse URL in sources/site.php on line 701 (version: 7.1.5, PHP version: 5.2.17, URL: /portal/cms/index.php?page=cms&keep_fatalistic=1) and the stack trace is: File '/home/mysite/var/portal/sources/failure.php' Line '674' Function 'get_html_trace' Args File '/home/mysite/var/portal/sources/global2.php' Line '969' Function '_fatal_exit' Args 'PHP WARNING [2] parse_url(https:///nameofmysite.com/portal) [<a href=\'http://www.php.net/manual/en/function.parse-url.php\'>function.parse-url.php</a>]: Unable to parse URL in sources/site.php on line 701' File '/home/mysite/var/portal/sources/failure.php' Line '214' Function 'fatal_exit' Args 'PHP WARNING [2] parse_url(https:///nameofmysite.com/portal) [<a href=\'http://www.php.net/manual/en/function.parse-url.php\'>function.parse-url.php</a>]: Unable to parse URL in sources/site.php on line 701' File '/home/mysite/var/portal/sources/global2.php' Line '843' Function '_Composr_error_handler' Args 'warning' 2 'parse_url(https:///nameofmysite.com/portal) [<a href=\'http://www.php.net/manual/en/function.parse-url.php\'>function.parse-url.php</a>]: Unable to parse URL' 'sources/site.php' 701 Function 'Composr_error_handler' Args ... File '/home/mysite/var/portal/sources/site.php' Line '701' Function 'parse_url' Args 'https:///nameofmysite.com/portal' File '/home/mysite/var/portal/cms/index.php' Line '50' Function 'do_site' Args Looking over the error messages I noticed that the get_base_url() function seems to be returning 'https:///nameofmysite.com/portal' hence the three slashes. BTW, my site has web-server level based https redirection activated so I'm not sure if this has an effect here as I've read over the help pages of Composr that SSL for Composr is page-based and is not meant to be used for this kind of network as mentioned in http://compo.sr/docs/tut_security.htm |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".
Comments
substr($base_url,strlen('http://'))
to
preg_replace('#^\w*://#','',$base_url)
--
This bug has happened because you've configured a base URL (when installing, not when debranding) that is https://, but you've also turned on SSL pages and it's making the false assumption it has to convert an http:// URL into an https:// URL.