summaryrefslogtreecommitdiffstats
path: root/wp-includes/functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-13 17:21:00 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-13 17:21:00 +0000
commit12de05107e4c8b006bde6ee8916f34eb476d08da (patch)
tree123ee54ecd1f3f777373b7df54a4604012d43640 /wp-includes/functions.php
parente51c7a9ca4bfdb45fa3ec7334bd33871e78c68b1 (diff)
downloadwordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.gz
wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.xz
wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.zip
WP Merge with revision 8075
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1328 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/functions.php')
-rw-r--r--wp-includes/functions.php46
1 files changed, 37 insertions, 9 deletions
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 89b4333..a4a5914 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -1071,7 +1071,7 @@ function wp_upload_dir( $time = NULL ) {
$siteurl = get_option( 'siteurl' );
$upload_path = get_option( 'upload_path' );
if ( trim($upload_path) === '' )
- $upload_path = 'wp-content/uploads';
+ $upload_path = WP_CONTENT_DIR . '/uploads';
$dir = $upload_path;
// $dir is absolute, $path is (maybe) relative to ABSPATH
@@ -1556,8 +1556,8 @@ function wp_ob_end_flush_all() {
*/
function require_wp_db() {
global $wpdb;
- if ( file_exists( ABSPATH . 'wp-content/db.php' ) )
- require_once( ABSPATH . 'wp-content/db.php' );
+ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
+ require_once( WP_CONTENT_DIR . '/db.php' );
else
require_once( ABSPATH . WPINC . '/wp-db.php' );
}
@@ -1566,8 +1566,8 @@ function dead_db() {
global $wpdb;
// Load custom DB error template, if present.
- if ( file_exists( ABSPATH . 'wp-content/db-error.php' ) ) {
- require_once( ABSPATH . 'wp-content/db-error.php' );
+ if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) {
+ require_once( WP_CONTENT_DIR . '/db-error.php' );
die();
}
@@ -1668,9 +1668,9 @@ function _deprecated_function($function, $version, $replacement=null) {
// Allow plugin to filter the output error trigger
if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_function_trigger_error', true )) {
if( !is_null($replacement) )
- trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead."), $function, $version, $replacement ) );
+ trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
else
- trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s with no alternative available."), $function, $version ) );
+ trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
}
}
@@ -1703,9 +1703,9 @@ function _deprecated_file($file, $version, $replacement=null) {
// Allow plugin to filter the output error trigger
if( defined('WP_DEBUG') && ( true === WP_DEBUG ) && apply_filters( 'deprecated_file_trigger_error', true )) {
if( !is_null($replacement) )
- trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead."), $file, $version, $replacement ) );
+ trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) );
else
- trigger_error( printf( __("%1$s is <strong>deprecated</strong> since version %2$s with no alternative available."), $file, $version ) );
+ trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) );
}
}
@@ -1763,4 +1763,32 @@ function validate_file( $file, $allowed_files = '' ) {
return 0;
}
+function is_ssl() {
+ return ( 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;
+}
+
+function force_ssl_login($force = '') {
+ static $forced;
+
+ if ( '' != $force ) {
+ $old_forcded = $forced;
+ $forced = $force;
+ return $old_forced;
+ }
+
+ return $forced;
+}
+
+function force_ssl_admin($force = '') {
+ static $forced;
+
+ if ( '' != $force ) {
+ $old_forcded = $forced;
+ $forced = $force;
+ return $old_forced;
+ }
+
+ return $forced;
+}
+
?>