You are here:  » Issues with rogue characters <br/> /n

Support Forum



Issues with rogue characters <br/> /n

Submitted by london on Mon, 2007-12-03 00:12 in

I've been using this excellent script for over a year now, mainly with data feeds from Affiliate Window, however I'm having some issues importing XML feeds from Paid on Results.

It seems when using the XML feed rogue line breaks are ending up in the database causing product links to break.

At the end of each field it appears there are /n being imported. When I view the database using PHPMY and view the html source of a product list for a paid on results merchant after a query within phpmy there are tags in the html splitting the product name.

brandxyz124214

However when I view the html of the website containing the products they are displayed as follows with no tag but the product link is broken onto a few lines. When you click on a link the details page does not display.

brandxyz
124214

One additional piece of information, In order to get a correct product name I'm using a filter. I'm doing a search and replace on merchant name then a text before %brand% %productname%. However I don't think this is connected as this processing to generate a product name works successfully with feeds from Affiliate Window etc.
I've tried just using a default field name (ie without any processing) and it still adds a line break at the end of the link.

I hope the above makes sense. What can I do to get the feed to work? Thanks.

Submitted by support on Mon, 2007-12-03 09:12

Hi,

Both binary newline (\n) and the HTML newline (<br />) should be stripped in one form or another during import, so i'm slightly confused as to how it is being allowed through.

Neither the brand or product name fields use strip_tags (this is only applied to the description), but both are normalised during import, which only permits 0-9, A-Z, a-z and SPACE (plus higher range characters depending on the character set in use).

The first thing to try would be a search and replace on <br /> (replace with nothing) against the brand and productname fields before concatenating them. If the HTML is in the feed and is being imported in your version of Price Tapestry (there have been minor changes over the year as issues have been resolved) then this should strip them - make sure that the search string you use is identical to the HTML that is being imported - the easiest thing to do is probably to view the source and then copy/paste from the source into the filter configuration page...

If this doesn't help - could you please email to me the following files from your site:

includes/tapestry.php
includes/admin.php

...and if possible a link to the feed itself, for example:

http://www.yoursite.com/feeds/merchant.txt

I'll then download it to my test server and take a look for you. Reply to your forum registration or reg code email is the easiest way to get me...

Cheers,
David.