Jump to content

SQL manager strips HTML tags from the query results


FranciscoVillen

Recommended Posts

Hi mates,

 

I'm using SQL Manager to export some info of products.

 

In my query I want to replace the newlines for br html tag. So, I use something like this in the sql sentence:

 (REPLACE(pl.description_short, '\r\n','<br />'))

But SQL Manager is stripping html tags in the field description_short when the CSV file is generated.

 

Do someone know a way to avoid that SQL manager strips html?.

 

Best regards.

Link to comment
Share on other sites

Hi Took if I put  <br> the sql manager doesn't remove it. But should it work as the <br> tag?, and there is another problem with < you are using the character ; which is problematic in a CSV file with fields separated by ;

 

Is it possible that SQL manager generate a CSV with a distinct character to separate fields?

Link to comment
Share on other sites

Thanks Tuk, I didn't know that.

 

I have reached the code where the tags are stripped.

 

It is in /controllers/admin/AdminRequestSqlController.php in the function generateExport it have inside a fputs call:

strip_tags($result[$name])

Changing for:

$result[$name]

It will avoid that html tags in description to be stripped.

 

I have done the change in the folder override, so it won't be removed if prestashop is updated.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...