Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

VanillaForums and MIME-Type application/xhtml+xml

cdavidcdavid New
edited August 2010 in Vanilla 2.0 - 2.8
Dear all,

I was wondering if I can enable the serving of VanillaForums pages with this respective mime-type (application/xhtml+xml). I need it in order to serve MathML content on the webpages.

I looked at applications/dashboard/views/default.master.php and found that if i replace the header there with something like
<?php $mime="application/xhtml+xml"; $charset="utf-8"; header("Content-Type: $mime;charset=$charset"); echo '<?xml version="1.0" encoding="utf-8"?>'; ?>

But, whenever I try to reload any page, I get an error:
XML Parsing Error: not well-formed Location: http://localhost/v/index.php?p=/discussion/3/sdgasdfa/#Item_5 Line Number 32, Column 93: <li class="NonTab SignOut"><a href="/v/index.php?p=/entry/leave/password/CI5BYN2IAFYG&Target=discussions">Sign Out</a></li>
because the & is not escaped.

First of all, am i doing the right thing?

Second of all, any idea how I can fix this error?

Thanks a lot,

Catalin

P.S.: Running Vanilla 2.0.1
Tagged:

Comments

  • cdavidcdavid New
    edited August 2010
    The culprit seems to be ./library/core/class.request.php

    Specifically, the line:

    $Query = str_replace('?', '&;', $Query);

    should be:

    $Query = str_replace('?', '&', $Query);

    in order to fit the XHTML standard (in which & should be escaped as & ).

    /cd
  • edited December 2010
    What to do if mime application/xhtml xml is still not recognized? The page loads fine in Firefox and Safari, and validates successfully as being XHTML 1.0 Strict. However under IE, trying to open the page results in a file download dialogue
  • That is a problem with the browser. IE 6 does not support XHTML. I'm not sure IE 7 actually supports it. But you should reside with a real browser, put a Firefox banner on your website (since FF actually supports XHTML -- MathML + SVG best) so that people can download it.

    One thing you might do is content negotiation with the client in the headers. IE will say that it's IE (in the headers -- UserAgent) and it will say Accept: text/html . In this case, you can redirect them to a static page in which you say they need to have FF or any other real browser.

    /cd
  • SS ✭✭
    edited December 2010
    http://caniuse.com/#feat=xhtml
    IEFirefoxSafariChromeOperaiOS SafariOpera MiniOpera MobileAndroid Browser
    Two versions back6.03.03.26.010.13.2
    Previous version7.03.54.07.010.54.1
    Current8.03.65.08.010.64.25.010.02.2
    Near Future (early 2011)4.09.011.0
    Future (mid/late 2011)9.06.010.0
    Waiting IE8 to expire.
  • I had no idea about this. Still, there is this MathPlayer plugin for IE that reads out math from an XHTML document, while also displaying it, so there can be a way around it.

    /cd
Sign In or Register to comment.