Forums

IPad2 app stripping html

  1. Hi everyone,

    I am using Libxml 2.6.32 and php 5.2.12 but for some reason when I try to post to my wordpress site via the wordpress app on the iPad2 all my HTML is stripped. Any ideas on how to fix this doozie?

    i.e. <img src="blahblahblah" > becomes imgsrc=blahblahblah

    Thanks!

  2. This should be a problem with your server using known broken combinations of PHP and libxml - http://josephscott.org/code/wordpress/plugin-libxml2-fix/

  3. I am having the same problem as the OP. I downloaded and installed LibXML2 Fix and it did not solve the problem.

    I have attempted including images with a post using various methods. The only way I can post an image is if I post through my laptop when signed-on as an administrator. Since this involves using my self-hosted server, and the image post is successful, I cannot believe the server is at fault.

    Additionally, I have noticed that prior to posting an image using the app, I can preview the post in the app and the image is displayed. However, if I attempt to edit the post prior to posting it, html characters are stripped by the edit function in the app. Therefore I can only believe the app itself is causing the problem.

    I have also attempted to add back the removed html characters in edit mode from my laptop after the image has posted. Correcting the html does not allow the image to be displayed; the corrected html is displayed as text.

    I use WP for iOS version 2.9 and iOS 4.3.5 (8L1) on an original iPad. On the server I have WP 3.2.1 and Theme Twenty Eleven with no widgets. The only plug-in I have activated is LibXML2 Fix. My self-hosted server uses PHP version 5.2.12. I do not know what version of LibXML is used.

    I hope this helps to correct an obvious bug somewhere in image posting process. I know from experience that this can work very well. In August 2010 I was posting images and text to WP on a self-hosted server from my iPhone. I could take a photo with iPhone, find it or any other in the photo library and post it with-out any problems.

  4. Problem solved, with the help of the last entry in this related post:

    http://ios.forums.wordpress.org/topic/post-with-image-error?replies=9#post-5256

    Following trabant66’s method, I changed the libxml2 and PHP versions in the libxml2-fix file (originally 2.6.27 and 5.2.9 respectively) to the versions actually used by my hosting provider. In my case that is PHP version 5.2.12 and libxml2 version 2.6.32.

    The libxml2-fix zip file is avalable here:

    http://josephscott.org/archives/2009/03/wordpress-libxml2-episode-iv-a-new-plugin/

    You’ll need to unzip the file and open the included PHP file in a reader such as TextWrangler (on a MAC). Make the following two changes as necessary to the code in the libxml2-fix file if the original libxml2-fix file does not solve the posting problem. Contact support for your host if you are unsure what versions of PHP and libxml2 are used.

    These are the two changes you’ll need to make to the libxml2-fix file. No other changes need to be made:

    if (
    LIBXML_DOTTED_VERSION == '2.6.32' <<<Change this to the version
    || LIBXML_DOTTED_VERSION == '2.7.0' on your hosts server.
    || LIBXML_DOTTED_VERSION == '2.7.1'
    || LIBXML_DOTTED_VERSION == '2.7.2'
    || (
    LIBXML_DOTTED_VERSION == '2.7.3'
    && version_compare( PHP_VERSION, '5.2.12', '<' ) <<<Change
    ) this to the version
    ) { on your
    hosts
    server.
    $HTTP_RAW_POST_DATA = str_replace( '<', '<', $HTTP_RAW_POST_DATA );
    $HTTP_RAW_POST_DATA = str_replace( '>', '>', $HTTP_RAW_POST_DATA );
    $HTTP_RAW_POST_DATA = str_replace( '&', '&', $HTTP_RAW_POST_DATA );
    }

    Save the changes and compress the revised file as a zip file. On the MAC select the revised file and from the Finder select Compress. Sign-on to your WordPress files and upload the zip file as a new plug-in and activate it. This worked for me - hope it works for you!

    With Many Thanks to trabant66!

Topic Closed

This topic has been closed to new replies.


About this Topic