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(
$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));