Jump to content

RSS feed syntax issue in str_replace


dbrimlow

Recommended Posts

I took over an application that sends an RSS feed with ads to craigslist.

 

The following is part of a str_replace that looks wrong to me, but I can't test it to check because it is not on a development server (only live).

 

The sibling "<![CDATA" of the named parent "<cl:previewHTML>" below is closed last, evan after the RDF root has closed. Can that be right under any circumstances?

 

Here is how it is:

 

$data1 = str_replace("<cl:previewHTML><![CDATA[", "", $data1);

$data1 = str_replace("</cl:previewHTML>", "", $data1);

$data1 = str_replace("</item>", "", $data1);

$data1 = str_replace("</rdf:RDF>", "", $data1);

$data1 = str_replace("]]>", "", $data1);

 

Wouldn't it need to be closed before its parent closes under any circumstances? Like:

 

$data1 = str_replace("<cl:previewHTML><![CDATA[", "", $data1);

$data1 = str_replace("]]>", "", $data1);

$data1 = str_replace("</cl:previewHTML>", "", $data1);

$data1 = str_replace("</item>", "", $data1);

$data1 = str_replace("</rdf:RDF>", "", $data1);

 

Is there enough of the code shown to determine, or do I need to post the whole concatenation?

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.