[wp-trac] [WordPress Trac] #3906: Bug : Windows Live Writer - PHP 5.2 - WordPress // Upload image

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 4 22:59:56 GMT 2007


#3906: Bug : Windows Live Writer - PHP 5.2 - WordPress // Upload image
---------------------------+------------------------------------------------
 Reporter:  momo360modena  |       Owner:  anonymous                                                  
     Type:  defect         |      Status:  new                                                        
 Priority:  normal         |   Milestone:  2.1.3                                                      
Component:  XML-RPC        |     Version:  2.1.2                                                      
 Severity:  major          |    Keywords:  wlw, bug, php5.2, 5.2, windows, live, writer, upload, image
---------------------------+------------------------------------------------
 Now :

 {{{
         $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '',
 $this->message);
         if (trim($this->message) == '') {
             return false;
         }
         $this->_parser = xml_parser_create();
 }}}

 Fix :

 {{{
 $rx = '/<?xml.*encoding=[\'"](.*?)[\'"].*?>/m';
   if ( preg_match($rx, $this->message, $m) ) {
   $encoding = strtoupper($m[1]);
 }
 else {
   $encoding = 'UTF-8';
 }
 $this->_parser = xml_parser_create($encoding);
 }}}

 Source :
 http://blog.kingtch.com/2007/02/01/55/upload-image-with-windows-live-
 writer-2.html

 Verify on 2 hosts PHP 5.2

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3906>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list