Opened 6 years ago
Closed 6 years ago
#3906 closed defect (bug) (worksforme)
Windows Live Writer can't upload image
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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 (1)
Change History (7)
momo360modena — 6 years ago
- Keywords reporter-feedback added
- Milestone changed from 2.1.3 to 2.2
- Owner changed from anonymous to westi
- Status changed from new to assigned
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().
- 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.
- 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+
comment:5
follow-up:
↓ 6
foolswisdom — 6 years ago
- Milestone changed from 2.2 to 2.3
Is the problem specific to PHP 5.2?
- Milestone 2.3 deleted
- Resolution set to worksforme
- Status changed from assigned to closed
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

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