From 5d3f27136043edf6a4c905e32903cdc045f26e14 Mon Sep 17 00:00:00 2001 From: ozhozh Date: Wed, 4 Aug 2010 13:01:45 +0000 Subject: [PATCH] Windows server detection function git-svn-id: http://yourls.googlecode.com/svn/trunk@466 12232710-3e20-11de-b438-597f59cd7555 --- admin/tools.php | 7 ++++--- includes/functions.php | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/admin/tools.php b/admin/tools.php index 5eae98b..1704da8 100644 --- a/admin/tools.php +++ b/admin/tools.php @@ -54,12 +54,13 @@ -

Prefix-n-Shorten

+

Prefix-n-Shorten

When viewing a page, you can also prefix its full URL: just head to your browser's address bar, add "/" to the beginning of the current URL (right before its 'http://' part) and hit enter.

-

Note: this will probably not work if your web server is running on Windows.

- +

Note: this will probably not work if your web server is running on Windows .

+ +

Secure passwordless API call

diff --git a/includes/functions.php b/includes/functions.php index 007aedb..e8ecbbe 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1463,6 +1463,11 @@ function yourls_is_admin() { return false; } +// Check if the server seems to be running on Windows. Not exactly sure how reliable this is. +function yourls_is_windows() { + return defined( 'DIRECTORY_SEPARATOR' ) && DIRECTORY_SEPARATOR == '\\'; +} + // Check if SSL is required. Returns bool. function yourls_needs_ssl() { if ( defined('YOURLS_ADMIN_SSL') && YOURLS_ADMIN_SSL == true ) -- 2.45.0