Wordpress 3.3.1-scripts
[autoinstalls/wordpress.git] / wp-app.php
index 6de52882063c8a21dbca5944f86c6aae6caf0217..323f832a8ba1d48e00f83f606cdc126d99abc56e 100644 (file)
@@ -216,14 +216,15 @@ class AtomServer {
        var $do_output = true;
 
        /**
-        * PHP4 constructor - Sets up object properties.
+        * Constructor - Sets up object properties.
         *
         * @since 2.2.0
         * @return AtomServer
         */
-       function AtomServer() {
+       function __construct() {
 
-               $this->script_name = array_pop( $var_by_ref = explode( '/', $_SERVER['SCRIPT_NAME'] ) );
+               $var_by_ref = explode( '/', $_SERVER['SCRIPT_NAME'] );
+               $this->script_name = array_pop( $var_by_ref );
                $this->app_base = site_url( $this->script_name . '/' );
 
                $this->selectors = array(
@@ -607,13 +608,13 @@ EOD;
 
                $slug = '';
                if ( isset( $_SERVER['HTTP_SLUG'] ) )
-                       $slug = sanitize_file_name( $_SERVER['HTTP_SLUG'] );
+                       $slug = $_SERVER['HTTP_SLUG'];
                elseif ( isset( $_SERVER['HTTP_TITLE'] ) )
-                       $slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] );
+                       $slug = $_SERVER['HTTP_TITLE'];
                elseif ( empty( $slug ) ) // just make a random name
                        $slug = substr( md5( uniqid( microtime() ) ), 0, 7);
                $ext = preg_replace( '|.*/([a-z0-9]+)|', '$1', $_SERVER['CONTENT_TYPE'] );
-               $slug = "$slug.$ext";
+               $slug = sanitize_file_name( "$slug.$ext" );
                $file = wp_upload_bits( $slug, NULL, $bits);
 
                log_app('wp_upload_bits returns:',print_r($file,true));