Forums / Templates, Stylesheets, Page Layout / Custom link to uploaded file not displayed correctly in shopping cart

Custom link to uploaded file not displayed correctly in shopping cart

Locked

Views: 3,449

Results 21 to 24 of 24
This thread is locked. New replies are disabled.
17 Aug 2007, 7:22 AM
#21
paulriedel avatar

paulriedel

New Zenner

Join Date:
Aug 2007
Posts:
37
Plugin Contributions:
0

Custom link to uploaded file not displayed correctly in shopping cart

DrByte:

The information is sanitized before display so that customers and hackers cannot inject rogue content into your site and end up exploiting your store.

This line in includes/modules/pages/shopping_cart/header_php.php handles that:```
$attrArray[$option]['products_options_values_name'] = zen_output_string_protected($attr_value) ;

> 
> If you wish to retain the security protection, then you'll need to find a different way to supply a link to the uploaded file.


Hi!

Thanks for your reply, but I don't quite understand.
If I was just to output <a>test</a>, that would also not work on the server and it would be output as "<a>test</a>". 
Doe the line you described really do *that*?

Thanks

- Paul
19 Aug 2007, 4:24 AM
#22
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Custom link to uploaded file not displayed correctly in shopping cart

All of the attribute description content is being converted to its html-encoded equivalents. This prevents customers from entering <script> and other rogue hacker-like things into descriptions and attribute values etc.
So, yes, <a>Test</a> will show up literally.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Aug 2007, 4:40 AM
#23
paulriedel avatar

paulriedel

New Zenner

Join Date:
Aug 2007
Posts:
37
Plugin Contributions:
0

Re: Custom link to uploaded file not displayed correctly in shopping cart

Aah, thanks, that makes sense!

Is there a way to easily disable this?

I mean if I limit users to only upload files that aren't directly readeable by the page that can't do any harm, right?

Thanks a lot!

  • Paul
19 Aug 2007, 6:08 AM
#24
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Custom link to uploaded file not displayed correctly in shopping cart

zen_output_string_protected() is what's doing the conversion.

feel free to change that to zen_output_string() if you dare and understand the risks

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.