issue #108: fixing dirname() for Windows when used for URLs instead of actual dirs
parent
b45c93f254
commit
3cc2c26abd
|
@ -15,6 +15,7 @@ not yet released
|
|||
* #103: Added Russian translation.
|
||||
* #105: Fixing check for websites with unverified SSL certificates.
|
||||
* #107: Fixing update job for Synology DSM Task Scheduler.
|
||||
* #108: URLs on Windows contained both back- and forward slashes.
|
||||
* #111: Generated urls for non-default ports included the port twice.
|
||||
* #110: Support for SMSGlobal SMS gateway <https://www.smsglobal.com/>.
|
||||
* Support for Danish SMS provider Smsit <http://www.smsit.dk/>
|
||||
|
|
|
@ -467,7 +467,11 @@ function psm_build_sms() {
|
|||
*/
|
||||
function psm_build_url($params = array(), $urlencode = true, $htmlentities = true) {
|
||||
$url = ($_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'];
|
||||
|
||||
// on Windows, dirname() adds both back- and forward slashes (http://php.net/dirname).
|
||||
// for urls, we only want the forward slashes.
|
||||
$url .= dirname($_SERVER['SCRIPT_NAME']) . '/';
|
||||
$url = str_replace('\\', '', $url);
|
||||
|
||||
if($params != null) {
|
||||
$url .= '?';
|
||||
|
|
Loading…
Reference in New Issue