Announcement

Collapse
No announcement yet.

Ampersand in RSS feed

Collapse
X
 
  • 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 http://blablabla.com/index.php?module=trata&some=other

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

    PHP Code:
    http://blabla.com/index.php?frontpage=shownews&newsid= 
    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.

    Comment


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

      http://otsoft.pl/rss.php source ->

      Code:
      <?xml version="1.0" encoding="ISO-8859-2" ?>
      
      <rss version="2.0"><channel>
      <title>Otsoft.pl News</title>
      <link>http://otsoft.pl</link>
      <description>Najnowsze wieśsci ze świata Open Tibia</description>
      <language>pl</language>
      <copyright>Copyright (c) Otsoft.pl</copyright>
      <lastBuildDate>Wed, 2 Aug 2006 21:29:37 +0200</lastBuildDate>
      
       <item>
      <link>http://otsoft.pl/index.php?frontpage=shownews&newsid=77</link>
      It`s a feed link.

      Code:
      url={feed:link}
      In 12 line is an error. Dunno why.

      Comment


      • #4
        http://otsoft.pl/rss.php

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

        Comment


        • #5
          Originally posted by Jake Bunce View Post
          http://otsoft.pl/rss.php

          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:

          http://otsoft.pl/index.php?shownewsnnewsid=45

          but it should be:

          http://otsoft.pl/index.php?shownews&newsid=45

          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.

          Comment


          • #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.

            Comment


            • #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?

              Comment


              • #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. :(

                Comment


                • #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:http://www2.jorba.org/phpBB3/syndication.php

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

                  Thanks.
                  Tim

                  Comment


                  • #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....

                    Comment


                    • #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?

                      Anybody?

                      Comment


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

                        http://bugs.php.net/bug.php?id=45996

                        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."

                        Comment


                        • #13
                          Thanks!

                          Comment

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