Ticket #3906 (closed defect: worksforme)

Opened 1 year ago

Last modified 1 year ago

Windows Live Writer can't upload image

Reported by: momo360modena Assigned to: westi
Priority: normal Milestone:
Component: XML-RPC Version: 2.1.2
Severity: minor Keywords: wlw, bug, php5.2, 5.2, windows, live, writer, upload, image reporter-feedback
Cc:

Description

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

Attachments

class-IXR.php (27.1 kB) - added by momo360modena on 03/04/07 23:01:11.

Change History

03/04/07 23:01:11 changed by momo360modena

  • attachment class-IXR.php added.

03/05/07 07:44:47 changed by westi

  • keywords changed from wlw, bug, php5.2, 5.2, windows, live, writer, upload, image to wlw, bug, php5.2, 5.2, windows, live, writer, upload, image reporter-feedback.
  • owner changed from anonymous to westi.
  • status changed from new to assigned.
  • milestone changed from 2.1.3 to 2.2.

Can we see an example of the xml generated by live writer so as to understand what you are changing and why?

(follow-up: ↓ 3 ) 03/05/07 17:19:35 changed by Otto42

The code change above is appearantly to pull out the encoding value from the xml declaration, if it's there, and then pass that along to xml_parser_create().

(in reply to: ↑ 2 ) 03/05/07 18:47:31 changed by westi

  • summary changed from Bug : Windows Live Writer - PHP 5.2 - WordPress // Upload image to Windows Live Writer can't upload image.

Replying to Otto42:

The code change above is appearantly to pull out the encoding value from the xml declaration, if it's there, and then pass that along to xml_parser_create().

True.

My worry here is that the linked blog entry has comments saying this doesn't fix the issue for other people.

I would like to see an example of the failed request to ensure we fix the actual cause of the problem.

I will see if i can get Windows Live Writer and try it against my test blog while I await further info from the reporter.

03/05/07 21:42:52 changed by westi

  • severity changed from major to minor.

Ok I have tried to reproduce this issue and I can upload fine with Windows Live Writer to my 2.2-bleeding install.

ENV: PHP 5.1.6-pl6-gentoo with Hardening-Patch 0.4.15

I can't see why xml_parser_create needs the encoding specifying to sucessfully decode the file as it autodetects in v5.0+

(follow-up: ↓ 6 ) 03/27/07 19:41:18 changed by foolswisdom

  • milestone changed from 2.2 to 2.3.

Is the problem specific to PHP 5.2?

(in reply to: ↑ 5 ) 03/27/07 21:12:37 changed by westi

  • status changed from assigned to closed.
  • resolution set to worksforme.
  • milestone deleted.

Replying to foolswisdom:

Is the problem specific to PHP 5.2?

Not from what I can see. My server is now upgraded to PHP 5.2 and this works fine still:

PHP 5.2.1-pl3-gentoo with Suhosin-Patch 0.9.6.2 Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

with Suhosin v0.9.17, Copyright (c) 2002-2006, by Hardened-PHP Project