No announcement yet.

Ampersand in RSS feed

  • Filter
  • Time
  • Show
Clear All
new posts

  • Ampersand in RSS feed

    Hello, my rss feed is working well, only one thing is not working properly.

    In feed link f.e

    bolded ampersand is not printed by rss feed. In my rss script i have:

    PHP Code: 
    so it should be fine, when i change & into & i have an error when i try to load feed in vB.

    How to change this?

  • #2
    What is the error you get when you change the ampersand?

    Is that the URL of the feed? I have never known vBulletin's RSS system to reject feeds because of the ampersand character.


    • #3
      XML Error: EntityRef: expecting ';' at Line 12 source ->

      <?xml version="1.0" encoding="ISO-8859-2" ?>
      <rss version="2.0"><channel>
      <title> News</title>
      <description>Najnowsze wieśsci ze świata Open Tibia</description>
      <copyright>Copyright (c)</copyright>
      <lastBuildDate>Wed, 2 Aug 2006 21:29:37 +0200</lastBuildDate>
      It`s a feed link.

      In 12 line is an error. Dunno why.


      • #4

        I just tested this feed on my test forum and it worked fine. What exactly do I need to do to reproduce the error?


        • #5
          Originally posted by Jake Bunce View Post

          I just tested this feed on my test forum and it worked fine. What exactly do I need to do to reproduce the error?
          Its working fine, becaouse i changed & to &amp; but in feed link there is:

          but it should be:

          Error will occur if i change in my php script &amp; to &.

          And the question is, how to add an ampersand in php script to make vbulletin printed it?
          Last edited by Pavlus; Tue 11 Nov '08, 4:34am.


          • #6
            The ampersand is stripped from the article link when it is posted?

            I have seen similar problems with links in the Admin CP that contain ampersands, where some servers strip out the ampersand and break the link. I had one customer who actually confirmed that he only had the problem under a specific version of PHP. I forget which version worked, but he tested both PHP4 and PHP5 and the problem only existed under one of those versions of PHP.

            So this might be related to your PHP configuration. If your host is willing then I recommend you upgrade your version of PHP to the latest stable version.


            • #7
              Yes ampersand is striped only in article link.

              In other cases - as you said in Admin Panel ther is no problem with it and actualy i have last stable - 5.2.6 version of PHP :/

              Maybe it is connected with iso-8859-2 encoding of mine rss.php file?


              • #8
                Originally posted by Pavlus View Post
                Maybe it is connected with iso-8859-2 encoding of mine rss.php file?
                It's possible. You can try working with some possible suspects like that. Unfortunately I don't have any specific explanations or fixes. :(


                • #9
                  Any fix?

                  I have a feed that is mysteriously doing the same thing...leaving the ampersand out of the url when {feed:link} is used.

                  The rss feed I'm have issue with is:

                  It looks like it is utf-8 encoding...'wouldn't think it would be an encoding issue.



                  • #10
                    It has something to do with server configuration. I copied my site verbatim, databases and all, to a box that I have sitting under my desk....and it works fine.

                    Sooo...all I know now is that a box with php 5.2.6-2ubuntu4 is happy...but my hosted site with php 5.2.8 isn't....


                    • #11
                      Okay, so now I know a little more....

                      I took a look at the xml being sent to the xml_parse function and in class_xml.php and it is happy. The parseddata array, though, after running the parser has the ampersands missing in links.

                      I ran php info on the system that everything works fine on and the one that doesn't. The only delta of note (keeping in mind I can barely spell php) is the internal_encoding for mbstring.

                      On the system where everything is fine I see this:
                      mbstring.internal_encoding => ISO-8859-1 => no value

                      On the system where it is broken I see this:
                      mbstring.internal_encoding => no value => no value

                      Am I onto something here?



                      • #12
                        I have since discovered the cause of this problem. This is the result of the following PHP bug:


                        The solution is posted in that bug report:

                        > Currently the only options are to build PHP
                        > with libxml2 <= 2.6.32 or build ext/xml with expat.

                        So you need to ask your web host to "build PHP with libxml2 <= 2.6.32 or build ext/xml with expat."


                        • #13


                          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.