Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

477
 
711
 
711
 
update-20051113.html
_><_ 1 -<html>
  2 -
  3 -<head>
  4 -<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  5 -<meta name=Generator content="Microsoft Word 11 (filtered)">
  6 -<title>osCommerce 2.2 Milestone 2 Update 051113</title>
  7 -<style>
  8 -<!--
  9 - /* Style Definitions */
  10 - p.MsoNormal, li.MsoNormal, div.MsoNormal
  11 -        {margin:0cm;
  12 -        margin-bottom:.0001pt;
  13 -        font-size:12.0pt;
  14 -        font-family:"Times New Roman";}
  15 -h1
  16 -        {margin-top:12.0pt;
  17 -        margin-right:0cm;
  18 -        margin-bottom:3.0pt;
  19 -        margin-left:0cm;
  20 -        page-break-after:avoid;
  21 -        font-size:16.0pt;
  22 -        font-family:Arial;}
  23 -h2
  24 -        {margin-top:12.0pt;
  25 -        margin-right:0cm;
  26 -        margin-bottom:3.0pt;
  27 -        margin-left:0cm;
  28 -        page-break-after:avoid;
  29 -        font-size:14.0pt;
  30 -        font-family:Arial;
  31 -        font-style:italic;}
  32 -h3
  33 -        {margin-top:12.0pt;
  34 -        margin-right:0cm;
  35 -        margin-bottom:3.0pt;
  36 -        margin-left:0cm;
  37 -        page-break-after:avoid;
  38 -        font-size:13.0pt;
  39 -        font-family:Arial;}
  40 -p.MsoToc1, li.MsoToc1, div.MsoToc1
  41 -        {margin:0cm;
  42 -        margin-bottom:.0001pt;
  43 -        font-size:12.0pt;
  44 -        font-family:"Times New Roman";}
  45 -p.MsoToc3, li.MsoToc3, div.MsoToc3
  46 -        {margin-top:0cm;
  47 -        margin-right:0cm;
  48 -        margin-bottom:0cm;
  49 -        margin-left:24.0pt;
  50 -        margin-bottom:.0001pt;
  51 -        font-size:12.0pt;
  52 -        font-family:"Times New Roman";}
  53 -p.MsoHeader, li.MsoHeader, div.MsoHeader
  54 -        {margin:0cm;
  55 -        margin-bottom:.0001pt;
  56 -        font-size:12.0pt;
  57 -        font-family:"Times New Roman";}
  58 -p.MsoFooter, li.MsoFooter, div.MsoFooter
  59 -        {margin:0cm;
  60 -        margin-bottom:.0001pt;
  61 -        font-size:12.0pt;
  62 -        font-family:"Times New Roman";}
  63 -a:link, span.MsoHyperlink
  64 -        {color:blue;
  65 -        text-decoration:underline;}
  66 -a:visited, span.MsoHyperlinkFollowed
  67 -        {color:purple;
  68 -        text-decoration:underline;}
  69 -pre
  70 -        {margin:0cm;
  71 -        margin-bottom:.0001pt;
  72 -        font-size:10.0pt;
  73 -        font-family:"Courier New";}
  74 -span.Heading1Char
  75 -        {font-family:Arial;
  76 -        font-weight:bold;}
  77 -p.NormalCourierNew, li.NormalCourierNew, div.NormalCourierNew
  78 -        {margin:0cm;
  79 -        margin-bottom:.0001pt;
  80 -        font-size:12.0pt;
  81 -        font-family:"Times New Roman";}
  82 -span.Heading3Char
  83 -        {font-family:Arial;
  84 -        font-weight:bold;}
  85 - /* Page Definitions */
  86 - @page Section1
  87 -        {size:612.0pt 792.0pt;
  88 -        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
  89 -div.Section1
  90 -        {page:Section1;}
  91 --->
  92 -</style>
  93 -
  94 -</head>
  95 -
  96 -<body lang=EN-US link=blue vlink=purple>
  97 -
  98 -<div class=Section1>
  99 -
  100 -<h1 align=center style='text-align:center'><a name="_Toc119693700"></a><a
  101 -name="_Toc119693027"></a><a name="_Toc119692912"></a><a name="_Toc119692858"></a><a
  102 -name="_Toc119473688"></a><a name="_Toc119399320"></a><a name="_Toc116415078"></a><a
  103 -name="_Toc116413327"></a><a name="_Toc115810646"></a><a name="_Toc114779446"></a><a
  104 -name="_Toc114755867"></a><a name="_Toc114755833"></a><a name="_Toc114753969"></a><a
  105 -name="_Toc114748813">osCommerce 2.2 Milestone 2</a> Update 051113</h1>
  106 -
  107 -<p class=MsoNormal align=center style='text-align:center'>Update Package 13<sup>th</sup>
  108 -November 2005</p>
  109 -
  110 -<p class=MsoNormal>&nbsp;</p>
  111 -
  112 -<p class=MsoNormal><b>&nbsp;</b></p>
  113 -
  114 -<p class=MsoNormal><b>&nbsp;</b></p>
  115 -
  116 -<p class=MsoNormal><b>&nbsp;</b></p>
  117 -
  118 -<p class=MsoNormal><b>Table of Contents</b></p>
  119 -
  120 -<p class=MsoNormal>&nbsp;</p>
  121 -
  122 -<p class=MsoNormal><u>Update 051113</u></p>
  123 -
  124 -<p class=MsoNormal>&nbsp;</p>
  125 -
  126 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693028"><span
  127 -lang=EN>customer_country_id in addressbook</span><span style='color:windowtext;
  128 -display:none;text-decoration:none'>. </span><span
  129 -style='color:windowtext;display:none;text-decoration:none'>2</span></a></span></p>
  130 -
  131 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  132 -
  133 -<p class=MsoNormal><u><span lang=EN>Update 051112</span></u></p>
  134 -
  135 -<p class=MsoNormal>&nbsp;</p>
  136 -
  137 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693703">Cannot
  138 -re-assign $this<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
  139 -style='color:windowtext;display:none;text-decoration:none'>3</span></a></span></p>
  140 -
  141 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693704"><span
  142 -lang=EN>limit -20, 20</span><span style='color:windowtext;display:none;
  143 -text-decoration:none'>. </span><span
  144 -style='color:windowtext;display:none;text-decoration:none'>4</span></a></span></p>
  145 -
  146 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693705">Database
  147 -Input Enhancement<span style='color:windowtext;display:none;text-decoration:
  148 -none'> </span><span
  149 -style='color:windowtext;display:none;text-decoration:none'>5</span></a></span></p>
  150 -
  151 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693706">Adding
  152 -Non-Existing Products To Cart<span style='color:windowtext;display:none;
  153 -text-decoration:none'> </span><span
  154 -style='color:windowtext;display:none;text-decoration:none'>7</span></a></span></p>
  155 -
  156 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693707">Session ID
  157 -XSS Issue<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
  158 -style='color:windowtext;display:none;text-decoration:none'>12</span></a></span></p>
  159 -
  160 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693708">Validate
  161 -Session ID<span style='color:windowtext;display:none;text-decoration:none'>.. </span><span
  162 -style='color:windowtext;display:none;text-decoration:none'>13</span></a></span></p>
  163 -
  164 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693709">File Manager
  165 -Problem<span style='color:windowtext;display:none;text-decoration:none'>.. </span><span
  166 -style='color:windowtext;display:none;text-decoration:none'>15</span></a></span></p>
  167 -
  168 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693710">HTTP Header
  169 -Injection<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
  170 -style='color:windowtext;display:none;text-decoration:none'>16</span></a></span></p>
  171 -
  172 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693711">E-Mail
  173 -Header Injection<span style='color:windowtext;display:none;text-decoration:
  174 -none'>. </span><span
  175 -style='color:windowtext;display:none;text-decoration:none'>18</span></a></span></p>
  176 -
  177 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693712">Contact Us
  178 -Form XSS Issue<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
  179 -style='color:windowtext;display:none;text-decoration:none'>21</span></a></span></p>
  180 -
  181 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693713">Open
  182 -Redirector<span style='color:windowtext;display:none;text-decoration:none'> </span><span
  183 -style='color:windowtext;display:none;text-decoration:none'>22</span></a></span></p>
  184 -
  185 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693714">Extra
  186 -Slashes In New Products<span style='color:windowtext;display:none;text-decoration:
  187 -none'>. </span><span
  188 -style='color:windowtext;display:none;text-decoration:none'>23</span></a></span></p>
  189 -
  190 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693715">Order Status
  191 -Filtering<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
  192 -style='color:windowtext;display:none;text-decoration:none'>25</span></a></span></p>
  193 -
  194 -<p class=MsoToc1><span class=MsoHyperlink><a href="#_Toc119693716">MySQL 5.0
  195 -Compatibility<span style='color:windowtext;display:none;text-decoration:none'>. </span><span
  196 -style='color:windowtext;display:none;text-decoration:none'>26</span></a></span></p>
  197 -
  198 -<h1><span lang=EN><br clear=all style='page-break-before:always'>
  199 -<a name="_Toc119693702"></a><a name="_Toc119693701"></a><a name="_Toc119693028">customer_country_id
  200 -in addressbook</a></span></h1>
  201 -
  202 -<p class=MsoNormal><a href="http://www.oscommerce.com/community/bugs,1662">http://www.oscommerce.com/community/bugs,1662</a></p>
  203 -
  204 -<p class=MsoNormal>&nbsp;</p>
  205 -
  206 -<h3>Problem:</h3>
  207 -
  208 -<p class=MsoNormal><span class=Heading3Char><span style='font-size:13.0pt'>&nbsp;</span></span></p>
  209 -
  210 -<p class=MsoNormal><span lang=EN>When the customer updates their address in the
  211 -My Account page, their country value is being stored in an incorrect variable
  212 -that can cause an incorrect tax rate value being used in product prices.</span></p>
  213 -
  214 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  215 -
  216 -<h3><span lang=EN>Solution:</span></h3>
  217 -
  218 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  219 -
  220 -<p class=MsoNormal><span lang=EN>The following lines must be replaced in
  221 -catalog/address_book_process.php:</span></p>
  222 -
  223 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  224 -
  225 -<p class=MsoNormal><span lang=EN>Line 150, from:</span></p>
  226 -
  227 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  228 -
  229 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  230 -color:blue'>$customer_country_id = <span style='background:yellow'>$country_id</span>;</span></p>
  231 -
  232 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  233 -
  234 -<p class=MsoNormal><span lang=EN>to:</span></p>
  235 -
  236 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  237 -
  238 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  239 -color:blue'>$customer_country_id = <span style='background:yellow'>$country</span>;</span></p>
  240 -
  241 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  242 -
  243 -<p class=MsoNormal><span lang=EN>Line 171, from:</span></p>
  244 -
  245 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  246 -
  247 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  248 -color:blue'>$customer_country_id = <span style='background:yellow'>$country_id</span>;</span></p>
  249 -
  250 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  251 -
  252 -<p class=MsoNormal><span lang=EN>to:</span></p>
  253 -
  254 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  255 -
  256 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  257 -color:blue'>$customer_country_id = <span style='background:yellow'>$country</span>;</span></p>
  258 -
  259 -<span lang=EN style='font-size:12.0pt;font-family:"Times New Roman"'><br
  260 -clear=all style='page-break-before:always'>
  261 -</span>
  262 -
  263 -<p class=MsoNormal><a name="_Toc119693703"></a><a name="_Toc119693029"><span
  264 -class=Heading1Char><span style='font-size:16.0pt'>Cannot re-assign $this</span></span></a></p>
  265 -
  266 -<p class=MsoNormal><a href="http://www.oscommerce.com/community/bugs,1650">http://www.oscommerce.com/community/bugs,1650</a></p>
  267 -
  268 -<p class=MsoNormal>&nbsp;</p>
  269 -
  270 -<h3>Problem:</h3>
  271 -
  272 -<p class=MsoNormal>&nbsp;</p>
  273 -
  274 -<p class=MsoNormal>Fatal error: Cannot re-assign $this in /path/to/catalog/admin/includes/classes/upload.php
  275 -on line 31</p>
  276 -
  277 -<p class=MsoNormal><b>&nbsp;</b></p>
  278 -
  279 -<h3>Solution:</h3>
  280 -
  281 -<p class=MsoNormal>&nbsp;</p>
  282 -
  283 -<p class=MsoNormal>Lines 27-34 in catalog/admin/includes/classes/upload.php
  284 -must be changed from:</p>
  285 -
  286 -<p class=MsoNormal>&nbsp;</p>
  287 -
  288 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  289 -color:blue'>if ( ($this-&gt;parse() == true) &amp;&amp; ($this-&gt;save() ==
  290 -true) ) {</span></p>
  291 -
  292 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  293 -color:blue'>� return true;</span></p>
  294 -
  295 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  296 -color:blue'>} else {</span></p>
  297 -
  298 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  299 -color:blue;background:yellow'>// self destruct</span></p>
  300 -
  301 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  302 -color:blue;background:yellow'>� $this = null;</span></p>
  303 -
  304 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  305 -color:blue'>&nbsp;</span></p>
  306 -
  307 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  308 -color:blue'>� return false;</span></p>
  309 -
  310 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  311 -color:blue'>}</span></p>
  312 -
  313 -<p class=MsoNormal>&nbsp;</p>
  314 -
  315 -<p class=MsoNormal>to:</p>
  316 -
  317 -<p class=MsoNormal>&nbsp;</p>
  318 -
  319 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  320 -color:blue'>if ( ($this-&gt;parse() == true) &amp;&amp; ($this-&gt;save() ==
  321 -true) ) {</span></p>
  322 -
  323 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  324 -color:blue'>� return true;</span></p>
  325 -
  326 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  327 -color:blue'>} else {</span></p>
  328 -
  329 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  330 -color:blue'>� return false;</span></p>
  331 -
  332 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  333 -color:blue'>}</span></p>
  334 -
  335 -<b><span style='font-size:10.0pt;font-family:"Courier New";color:blue'><br
  336 -clear=all style='page-break-before:always'>
  337 -</span></b>
  338 -
  339 -<h1><a name="_Toc119693704"></a><a name="_Toc119693030"><span lang=EN>limit
  340 --20, 20</span></a></h1>
  341 -
  342 -<p class=MsoNormal><span lang=EN><a
  343 -href="http://www.oscommerce.com/community/bugs,1605">http://www.oscommerce.com/community/bugs,1605</a></span></p>
  344 -
  345 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  346 -
  347 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  348 -
  349 -<h3><span lang=EN>Problem:</span></h3>
  350 -
  351 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  352 -
  353 -<p class=MsoNormal><span lang=EN>1064 - You have an error in your SQL syntax;
  354 -check the manual that corresponds to your MySQL server version for the right
  355 -syntax to use near '-20, 20' at line 1</span></p>
  356 -
  357 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  358 -
  359 -<h3><span lang=EN>Solution:</span></h3>
  360 -
  361 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  362 -
  363 -<p class=MsoNormal><span lang=EN>Line 67 in catalog/includes/classes/split_page_results.php
  364 -must be changed from:</span></p>
  365 -
  366 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  367 -
  368 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  369 -color:blue'>$this-&gt;sql_query .= &quot; limit &quot; . <span
  370 -style='background:yellow'>$offset</span> . &quot;, &quot; . $this-&gt;number_of_rows_per_page;</span></p>
  371 -
  372 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  373 -
  374 -<p class=MsoNormal><span lang=EN>to:</span></p>
  375 -
  376 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  377 -
  378 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  379 -color:blue'>$this-&gt;sql_query .= &quot; limit &quot; . <span
  380 -style='background:yellow'>max($offset, 0)</span> . &quot;, &quot; . $this-&gt;number_of_rows_per_page;</span></p>
  381 -
  382 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  383 -
  384 -<p class=MsoNormal><span lang=EN>Line 38 in
  385 -catalog/admin/includes/classes/split_page_results.php must be changed from:</span></p>
  386 -
  387 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  388 -
  389 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  390 -color:blue'>$sql_query .= &quot; limit &quot; . <span style='background:yellow'>$offset</span>
  391 -. &quot;, &quot; . $max_rows_per_page;</span></p>
  392 -
  393 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  394 -
  395 -<p class=MsoNormal><span lang=EN>to:</span></p>
  396 -
  397 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  398 -
  399 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  400 -color:blue'>$sql_query .= &quot; limit &quot; . <span style='background:yellow'>max($offset,
  401 -0)</span> . &quot;, &quot; . $max_rows_per_page;</span></p>
  402 -
  403 -<b><span lang=EN style='font-size:16.0pt;font-family:Arial'><br clear=all
  404 -style='page-break-before:always'>
  405 -</span></b>
  406 -
  407 -<h1><a name="_Toc119693705"></a><a name="_Toc119693031">Database Input
  408 -Enhancement</a></h1>
  409 -
  410 -<p class=MsoNormal>&nbsp;</p>
  411 -
  412 -<h3>Problem:</h3>
  413 -
  414 -<p class=MsoNormal>&nbsp;</p>
  415 -
  416 -<p class=MsoNormal>Native MySQL functions should be used in preference to the
  417 -addslashes() function, to properly protect the SQL queries being executed on
  418 -the database server.</p>
  419 -
  420 -<p class=MsoNormal>&nbsp;</p>
  421 -
  422 -<h3>Solution:</h3>
  423 -
  424 -<p class=MsoNormal>&nbsp;</p>
  425 -
  426 -<p class=MsoNormal>The following function must be replaced in
  427 -catalog/includes/functions/database.php.</p>
  428 -
  429 -<p class=MsoNormal>&nbsp;</p>
  430 -
  431 -<p class=MsoNormal>Lines 126-128, from:</p>
  432 -
  433 -<p class=MsoNormal>&nbsp;</p>
  434 -
  435 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  436 -color:blue'>function tep_db_input($string) {</span></p>
  437 -
  438 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  439 -color:blue'>� return addslashes($string);</span></p>
  440 -
  441 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  442 -color:blue'>}</span></p>
  443 -
  444 -<p class=MsoNormal>&nbsp;</p>
  445 -
  446 -<p class=MsoNormal>to:</p>
  447 -
  448 -<p class=MsoNormal>&nbsp;</p>
  449 -
  450 -<pre><span style='font-size:9.0pt;color:blue'>function tep_db_input($string, $link = 'db_link') {</span></pre><pre><span
  451 -style='font-size:9.0pt;color:blue'>� global $$link;</span></pre><pre><span
  452 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  453 -style='font-size:9.0pt;color:blue'>� if (function_exists('mysql_real_escape_string')) {</span></pre><pre><span
  454 -style='font-size:9.0pt;color:blue'>��� return mysql_real_escape_string($string, $$link);</span></pre><pre><span
  455 -style='font-size:9.0pt;color:blue'>� } elseif (function_exists('mysql_escape_string')) {</span></pre><pre><span
  456 -style='font-size:9.0pt;color:blue'>��� return mysql_escape_string($string);</span></pre><pre><span
  457 -style='font-size:9.0pt;color:blue'>� }</span></pre><pre><span style='font-size:
  458 -9.0pt;color:blue'>&nbsp;</span></pre><pre><span style='font-size:9.0pt;
  459 -color:blue'>� return addslashes($string);</span></pre><pre><span
  460 -style='font-size:9.0pt;color:blue'>}</span></pre>
  461 -
  462 -<p class=MsoNormal>&nbsp;</p>
  463 -
  464 -<p class=MsoNormal>The following function must be replaced in
  465 -catalog/admin/includes/functions/database.php.</p>
  466 -
  467 -<p class=MsoNormal>&nbsp;</p>
  468 -
  469 -<p class=MsoNormal>Lines 130-132, from:</p>
  470 -
  471 -<p class=MsoNormal>&nbsp;</p>
  472 -
  473 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  474 -color:blue'>function tep_db_input($string) {</span></p>
  475 -
  476 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  477 -color:blue'>� return addslashes($string);</span></p>
  478 -
  479 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  480 -color:blue'>}</span></p>
  481 -
  482 -<p class=MsoNormal>&nbsp;</p>
  483 -
  484 -<span style='font-size:12.0pt;font-family:"Times New Roman"'><br clear=all
  485 -style='page-break-before:always'>
  486 -</span>
  487 -
  488 -<p class=MsoNormal>to:</p>
  489 -
  490 -<p class=MsoNormal>&nbsp;</p>
  491 -
  492 -<pre><span style='font-size:9.0pt;color:blue'>function tep_db_input($string, $link = 'db_link') {</span></pre><pre><span
  493 -style='font-size:9.0pt;color:blue'>� global $$link;</span></pre><pre><span
  494 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  495 -style='font-size:9.0pt;color:blue'>� if (function_exists('mysql_real_escape_string')) {</span></pre><pre><span
  496 -style='font-size:9.0pt;color:blue'>��� return mysql_real_escape_string($string, $$link);</span></pre><pre><span
  497 -style='font-size:9.0pt;color:blue'>� } elseif (function_exists('mysql_escape_string')) {</span></pre><pre><span
  498 -style='font-size:9.0pt;color:blue'>��� return mysql_escape_string($string);</span></pre><pre><span
  499 -style='font-size:9.0pt;color:blue'>� }</span></pre><pre><span style='font-size:
  500 -9.0pt;color:blue'>&nbsp;</span></pre><pre><span style='font-size:9.0pt;
  501 -color:blue'>� return addslashes($string);</span></pre><pre><span
  502 -style='font-size:9.0pt;color:blue'>}</span></pre><b><span style='font-size:
  503 -16.0pt;font-family:Arial'><br clear=all style='page-break-before:always'>
  504 -</span></b>
  505 -
  506 -<h1><a name="_Toc119693706"></a><a name="_Toc119693032">Adding Non-Existing
  507 -Products To Cart</a></h1>
  508 -
  509 -<p class=MsoNormal><a href="http://www.oscommerce.com/community/bugs,1617">http://www.oscommerce.com/community/bugs,1617</a></p>
  510 -
  511 -<p class=MsoNormal>&nbsp;</p>
  512 -
  513 -<h3>Problem:</h3>
  514 -
  515 -<p class=MsoNormal>&nbsp;</p>
  516 -
  517 -<p class=MsoNormal>It is possible to add non-existing products into the
  518 -shopping cart which may prevent customers from removing the products from their
  519 -cart.</p>
  520 -
  521 -<p class=MsoNormal>&nbsp;</p>
  522 -
  523 -<h3>Solution:</h3>
  524 -
  525 -<p class=MsoNormal>&nbsp;</p>
  526 -
  527 -<p class=MsoNormal>The following functions must be replaced in
  528 -catalog/includes/functions/general.php.</p>
  529 -
  530 -<p class=MsoNormal>&nbsp;</p>
  531 -
  532 -<p class=MsoNormal>Lines 912-921, from:</p>
  533 -
  534 -<p class=MsoNormal>&nbsp;</p>
  535 -
  536 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  537 -color:blue'>function tep_get_uprid($prid, $params) {</span></p>
  538 -
  539 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  540 -color:blue'>� $uprid = $prid;</span></p>
  541 -
  542 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  543 -color:blue'>� if ( (is_array($params)) &amp;&amp; (!strstr($prid, '{')) ) {</span></p>
  544 -
  545 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  546 -color:blue'>��� while (list($option, $value) = each($params)) {</span></p>
  547 -
  548 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  549 -color:blue'>����� $uprid = $uprid . '{' . $option . '}' . $value;</span></p>
  550 -
  551 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  552 -color:blue'>� ��}</span></p>
  553 -
  554 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  555 -color:blue'>� }</span></p>
  556 -
  557 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  558 -color:blue'>&nbsp;</span></p>
  559 -
  560 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  561 -color:blue'>� return $uprid;</span></p>
  562 -
  563 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  564 -color:blue'>}</span></p>
  565 -
  566 -<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
  567 -color:blue'>&nbsp;</span></p>
  568 -
  569 -<p class=MsoNormal>to:</p>
  570 -
  571 -<p class=MsoNormal>&nbsp;</p>
  572 -
  573 -<pre><span style='font-size:9.0pt;color:blue'>function tep_get_uprid($prid, $params) {</span></pre><pre><span
  574 -style='font-size:9.0pt;color:blue'>� if (is_numeric($prid)) {</span></pre><pre><span
  575 -style='font-size:9.0pt;color:blue'>��� $uprid = $prid;</span></pre><pre><span
  576 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  577 -style='font-size:9.0pt;color:blue'>��� if (is_array($params) &amp;&amp; (sizeof($params) &gt; 0)) {</span></pre><pre><span
  578 -style='font-size:9.0pt;color:blue'>����� $attributes_check = true;</span></pre><pre><span
  579 -style='font-size:9.0pt;color:blue'>����� $attributes_ids = '';</span></pre><pre><span
  580 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  581 -style='font-size:9.0pt;color:blue'>����� reset($params);</span></pre><pre><span
  582 -style='font-size:9.0pt;color:blue'>����� while (list($option, $value) = each($params)) {</span></pre><pre><span
  583 -style='font-size:9.0pt;color:blue'>������� if (is_numeric($option) &amp;&amp; is_numeric($value)) {</span></pre><pre><span
  584 -style='font-size:9.0pt;color:blue'>��������� $attributes_ids .= '{' . (int)$option . '}' . (int)$value;</span></pre><pre><span
  585 -style='font-size:9.0pt;color:blue'>������� } else {</span></pre><pre><span
  586 -style='font-size:9.0pt;color:blue'>��������� $attributes_check = false;</span></pre><pre><span
  587 -style='font-size:9.0pt;color:blue'>��������� break;</span></pre><pre><span
  588 -style='font-size:9.0pt;color:blue'> �������}</span></pre><pre><span
  589 -style='font-size:9.0pt;color:blue'>����� }</span></pre><pre><span
  590 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  591 -style='font-size:9.0pt;color:blue'>����� if ($attributes_check == true) {</span></pre><pre><span
  592 -style='font-size:9.0pt;color:blue'>������� $uprid .= $attributes_ids;</span></pre><pre><span
  593 -style='font-size:9.0pt;color:blue'>����� }</span></pre><pre><span
  594 -style='font-size:9.0pt;color:blue'>��� }</span></pre><pre><span
  595 -style='font-size:9.0pt;color:blue'>� } else {</span></pre><pre><span
  596 -style='font-size:9.0pt;color:blue'>��� $uprid = tep_get_prid($prid);</span></pre><pre><span
  597 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  598 -style='font-size:9.0pt;color:blue'>��� if (is_numeric($uprid)) {</span></pre><pre><span
  599 -style='font-size:9.0pt;color:blue'>����� if (strpos($prid, '{') !== false) {</span></pre><pre><span
  600 -style='font-size:9.0pt;color:blue'>������� $attributes_check = true;</span></pre><pre><span
  601 -style='font-size:9.0pt;color:blue'>������� $attributes_ids = '';</span></pre><pre><span
  602 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  603 -style='font-size:9.0pt;color:blue'>// strpos()+1 to remove up to and including the first { which would create an empty array element in explode()</span></pre><pre><span
  604 -style='font-size:9.0pt;color:blue'>������� $attributes = explode('{', substr($prid, strpos($prid, '{')+1));</span></pre><pre><span
  605 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  606 -style='font-size:9.0pt;color:blue'>������� for ($i=0, $n=sizeof($attributes); $i&lt;$n; $i++) {</span></pre><pre><span
  607 -style='font-size:9.0pt;color:blue'>��������� $pair = explode('}', $attributes[$i]);</span></pre><pre><span
  608 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  609 -style='font-size:9.0pt;color:blue'>��������� if (is_numeric($pair[0]) &amp;&amp; is_numeric($pair[1])) {</span></pre><pre><span
  610 -style='font-size:9.0pt;color:blue'>����������� $attributes_ids .= '{' . (int)$pair[0] . '}' . (int)$pair[1];</span></pre><pre><span
  611 -style='font-size:9.0pt;color:blue'>��������� } else {</span></pre><pre><span
  612 -style='font-size:9.0pt;color:blue'>����������� $attributes_check = false;</span></pre><pre><span
  613 -style='font-size:9.0pt;color:blue'>����������� break;</span></pre><pre><span
  614 -style='font-size:9.0pt;color:blue'>��������� }</span></pre><pre><span
  615 -style='font-size:9.0pt;color:blue'>������� }</span></pre><pre><span
  616 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  617 -style='font-size:9.0pt;color:blue'>������� if ($attributes_check == true) {</span></pre><pre><span
  618 -style='font-size:9.0pt;color:blue'>��������� $uprid .= $attributes_ids;</span></pre><pre><span
  619 -style='font-size:9.0pt;color:blue'>������� }</span></pre><pre><span
  620 -style='font-size:9.0pt;color:blue'>����� }</span></pre><pre><span
  621 -style='font-size:9.0pt;color:blue'>��� } else {</span></pre><pre><span
  622 -style='font-size:9.0pt;color:blue'>����� return false;</span></pre><pre><span
  623 -style='font-size:9.0pt;color:blue'>��� }</span></pre><pre><span
  624 -style='font-size:9.0pt;color:blue'>� }</span></pre><pre><span style='font-size:
  625 -9.0pt;color:blue'>&nbsp;</span></pre><pre><span style='font-size:9.0pt;
  626 -color:blue'>� return $uprid;</span></pre><pre><span style='font-size:9.0pt;
  627 -color:blue'>}</span></pre><pre>&nbsp;</pre>
  628 -
  629 -<p class=MsoNormal>Lines 925-929, from:</p>
  630 -
  631 -<p class=MsoNormal>&nbsp;</p>
  632 -
  633 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  634 -color:blue'>function tep_get_prid($uprid) {</span></p>
  635 -
  636 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  637 -color:blue'>� $pieces = explode('{', $uprid);</span></p>
  638 -
  639 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  640 -color:blue'>&nbsp;</span></p>
  641 -
  642 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  643 -color:blue'>� return $pieces[0];</span></p>
  644 -
  645 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  646 -color:blue'>}</span></p>
  647 -
  648 -<p class=MsoNormal>&nbsp;</p>
  649 -
  650 -<p class=MsoNormal>to:</p>
  651 -
  652 -<pre>&nbsp;</pre><pre><span style='font-size:9.0pt;color:blue'>function tep_get_prid($uprid) {</span></pre><pre><span
  653 -style='font-size:9.0pt;color:blue'>� $pieces = explode('{', $uprid);</span></pre><pre><span
  654 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  655 -style='font-size:9.0pt;color:blue'>� if (is_numeric($pieces[0])) {</span></pre><pre><span
  656 -style='font-size:9.0pt;color:blue'>��� return $pieces[0];</span></pre><pre><span
  657 -style='font-size:9.0pt;color:blue'>� } else {</span></pre><pre><span
  658 -style='font-size:9.0pt;color:blue'>��� return false;</span></pre><pre><span
  659 -style='font-size:9.0pt;color:blue'>� }</span></pre><pre><span style='font-size:
  660 -9.0pt;color:blue'>}</span></pre><pre><span style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><span
  661 -style='font-size:12.0pt;font-family:"Times New Roman"'><br clear=all
  662 -style='page-break-before:always'>
  663 -</span>
  664 -
  665 -<p class=MsoNormal>The following functions must be replaced in
  666 -catalog/includes/classes/shopping_cart.php.</p>
  667 -
  668 -<p class=MsoNormal>&nbsp;</p>
  669 -
  670 -<p class=MsoNormal>Lines 78-108, from:</p>
  671 -
  672 -<p class=MsoNormal>&nbsp;</p>
  673 -
  674 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  675 -color:blue'>function add_cart($products_id, $qty = '1', $attributes = '',
  676 -$notify = true) {</span></p>
  677 -
  678 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  679 -color:blue'>� global $new_products_id_in_cart, $customer_id;</span></p>
  680 -
  681 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  682 -color:blue'>&nbsp;</span></p>
  683 -
  684 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  685 -color:blue'>� $products_id = tep_get_uprid($products_id, $attributes);</span></p>
  686 -
  687 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  688 -color:blue'>� if ($notify == true) {</span></p>
  689 -
  690 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  691 -color:blue'>��� $new_products_id_in_cart = $products_id;</span></p>
  692 -
  693 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  694 -color:blue'>��� tep_session_register('new_products_id_in_cart');</span></p>
  695 -
  696 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  697 -color:blue'>� }</span></p>
  698 -
  699 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  700 -color:blue'>&nbsp;</span></p>
  701 -
  702 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  703 -color:blue'>� if ($this-&gt;in_cart($products_id)) {</span></p>
  704 -
  705 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  706 -color:blue'>��� $this-&gt;update_quantity($products_id, $qty, $attributes);</span></p>
  707 -
  708 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  709 -color:blue'>� } else {</span></p>
  710 -
  711 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  712 -color:blue'>��� $this-&gt;contents[] = array($products_id);</span></p>
  713 -
  714 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  715 -color:blue'>��� $this-&gt;contents[$products_id] = array('qty' =&gt; $qty);</span></p>
  716 -
  717 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  718 -color:blue'>// insert into database</span></p>
  719 -
  720 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  721 -color:blue'>��� if (tep_session_is_registered('customer_id'))
  722 -tep_db_query(&quot;insert into &quot; . TABLE_CUSTOMERS_BASKET . &quot;
  723 -(customers_id, products_id, customers_basket_quantity,
  724 -customers_basket_date_added) values ('&quot; . (int)$customer_id . &quot;',
  725 -'&quot; . tep_db_input($products_id) . &quot;', '&quot; . $qty . &quot;',
  726 -'&quot; . date('Ymd') . &quot;')&quot;);</span></p>
  727 -
  728 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  729 -color:blue'>&nbsp;</span></p>
  730 -
  731 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  732 -color:blue'>��� if (is_array($attributes)) {</span></p>
  733 -
  734 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  735 -color:blue'>����� reset($attributes);</span></p>
  736 -
  737 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  738 -color:blue'>����� while (list($option, $value) = each($attributes)) {</span></p>
  739 -
  740 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  741 -color:blue'>������� $this-&gt;contents[$products_id]['attributes'][$option] =
  742 -$value;</span></p>
  743 -
  744 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  745 -color:blue'>// insert into database</span></p>
  746 -
  747 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  748 -color:blue'>������� if (tep_session_is_registered('customer_id'))
  749 -tep_db_query(&quot;insert into &quot; . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . &quot;
  750 -(customers_id, products_id, products_options_id, products_options_value_id)
  751 -values ('&quot; . (int)$customer_id . &quot;', '&quot; .
  752 -tep_db_input($products_id) . &quot;', '&quot; . (int)$option . &quot;', '&quot;
  753 -. (int)$value . &quot;')&quot;);</span></p>
  754 -
  755 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  756 -color:blue'>����� }</span></p>
  757 -
  758 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  759 -color:blue'>��� }</span></p>
  760 -
  761 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  762 -color:blue'>� }</span></p>
  763 -
  764 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  765 -color:blue'>� $this-&gt;cleanup();</span></p>
  766 -
  767 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  768 -color:blue'>&nbsp;</span></p>
  769 -
  770 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  771 -color:blue'>// assign a temporary unique ID to the order contents to prevent
  772 -hack attempts during the checkout procedure</span></p>
  773 -
  774 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  775 -color:blue'>� $this-&gt;cartID = $this-&gt;generate_cart_id();</span></p>
  776 -
  777 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  778 -color:blue'>}</span></p>
  779 -
  780 -<span style='font-size:12.0pt;font-family:"Times New Roman"'><br clear=all
  781 -style='page-break-before:always'>
  782 -</span>
  783 -
  784 -<p class=MsoNormal>to:</p>
  785 -
  786 -<p class=MsoNormal>&nbsp;</p>
  787 -
  788 -<pre><span style='font-size:9.0pt;color:blue'>function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {</span></pre><pre><span
  789 -style='font-size:9.0pt;color:blue'>� global $new_products_id_in_cart, $customer_id;</span></pre><pre><span
  790 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  791 -style='font-size:9.0pt;color:blue'>� $products_id_string = tep_get_uprid($products_id, $attributes);</span></pre><pre><span
  792 -style='font-size:9.0pt;color:blue'>� $products_id = tep_get_prid($products_id_string);</span></pre><pre><span
  793 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  794 -style='font-size:9.0pt;color:blue'>� if (is_numeric($products_id) &amp;&amp; is_numeric($qty)) {</span></pre><pre><span
  795 -style='font-size:9.0pt;color:blue'>��� $check_product_query = tep_db_query(&quot;select products_status from &quot; . TABLE_PRODUCTS . &quot; where products_id = '&quot; . (int)$products_id . &quot;'&quot;);</span></pre><pre><span
  796 -style='font-size:9.0pt;color:blue'>��� $check_product = tep_db_fetch_array($check_product_query);</span></pre><pre><span
  797 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  798 -style='font-size:9.0pt;color:blue'>��� if (($check_product !== false) &amp;&amp; ($check_product['products_status'] == '1')) {</span></pre><pre><span
  799 -style='font-size:9.0pt;color:blue'>����� if ($notify == true) {</span></pre><pre><span
  800 -style='font-size:9.0pt;color:blue'>������� $new_products_id_in_cart = $products_id;</span></pre><pre><span
  801 -style='font-size:9.0pt;color:blue'>������� tep_session_register('new_products_id_in_cart');</span></pre><pre><span
  802 -style='font-size:9.0pt;color:blue'>����� }</span></pre><pre><span
  803 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  804 -style='font-size:9.0pt;color:blue'>����� if ($this-&gt;in_cart($products_id_string)) {</span></pre><pre><span
  805 -style='font-size:9.0pt;color:blue'>������� $this-&gt;update_quantity($products_id_string, $qty, $attributes);</span></pre><pre><span
  806 -style='font-size:9.0pt;color:blue'>����� } else {</span></pre><pre><span
  807 -style='font-size:9.0pt;color:blue'>� ������$this-&gt;contents[$products_id_string] = array('qty' =&gt; $qty);</span></pre><pre><span
  808 -style='font-size:9.0pt;color:blue'>// insert into database</span></pre><pre><span
  809 -style='font-size:9.0pt;color:blue'>������� if (tep_session_is_registered('customer_id')) tep_db_query(&quot;insert into &quot; . TABLE_CUSTOMERS_BASKET . &quot; (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('&quot; . (int)$customer_id . &quot;', '&quot; . tep_db_input($products_id_string) . &quot;', '&quot; . (int)$qty . &quot;', '&quot; . date('Ymd') . &quot;')&quot;);</span></pre><pre><span
  810 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  811 -style='font-size:9.0pt;color:blue'>������� if (is_array($attributes)) {</span></pre><pre><span
  812 -style='font-size:9.0pt;color:blue'>��������� reset($attributes);</span></pre><pre><span
  813 -style='font-size:9.0pt;color:blue'>��������� while (list($option, $value) = each($attributes)) {</span></pre><pre><span
  814 -style='font-size:9.0pt;color:blue'>����������� $this-&gt;contents[$products_id_string]['attributes'][$option] = $value;</span></pre><pre><span
  815 -style='font-size:9.0pt;color:blue'>// insert into database</span></pre><pre><span
  816 -style='font-size:9.0pt;color:blue'>����������� if (tep_session_is_registered('customer_id')) tep_db_query(&quot;insert into &quot; . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . &quot; (customers_id, products_id, products_options_id, products_options_value_id) values ('&quot; . (int)$customer_id . &quot;', '&quot; . tep_db_input($products_id_string) . &quot;', '&quot; . (int)$option . &quot;', '&quot; . (int)$value . &quot;')&quot;);</span></pre><pre><span
  817 -style='font-size:9.0pt;color:blue'>��������� }</span></pre><pre><span
  818 -style='font-size:9.0pt;color:blue'>������� }</span></pre><pre><span
  819 -style='font-size:9.0pt;color:blue'>����� }</span></pre><pre><span
  820 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  821 -style='font-size:9.0pt;color:blue'>����� $this-&gt;cleanup();</span></pre><pre><span
  822 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  823 -style='font-size:9.0pt;color:blue'>// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure</span></pre><pre><span
  824 -style='font-size:9.0pt;color:blue'>����� $this-&gt;cartID = $this-&gt;generate_cart_id();</span></pre><pre><span
  825 -style='font-size:9.0pt;color:blue'>��� }</span></pre><pre><span
  826 -style='font-size:9.0pt;color:blue'>� }</span></pre><pre><span style='font-size:
  827 -9.0pt;color:blue'>}</span></pre><span style='font-size:12.0pt;font-family:"Times New Roman"'><br
  828 -clear=all style='page-break-before:always'>
  829 -</span>
  830 -
  831 -<p class=MsoNormal>Lines 110-127, from:</p>
  832 -
  833 -<p class=MsoNormal>&nbsp;</p>
  834 -
  835 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  836 -color:blue'>function update_quantity($products_id, $quantity = '', $attributes
  837 -= '') {</span></p>
  838 -
  839 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  840 -color:blue'>� global $customer_id;</span></p>
  841 -
  842 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  843 -color:blue'>&nbsp;</span></p>
  844 -
  845 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  846 -color:blue'>� if (empty($quantity)) return true; // nothing needs to be updated
  847 -if theres no quantity, so we return true..</span></p>
  848 -
  849 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  850 -color:blue'>&nbsp;</span></p>
  851 -
  852 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  853 -color:blue'>� $this-&gt;contents[$products_id] = array('qty' =&gt; $quantity);</span></p>
  854 -
  855 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  856 -color:blue'>// update database</span></p>
  857 -
  858 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  859 -color:blue'>� if (tep_session_is_registered('customer_id'))
  860 -tep_db_query(&quot;update &quot; . TABLE_CUSTOMERS_BASKET . &quot; set
  861 -customers_basket_quantity = '&quot; . $quantity . &quot;' where customers_id =
  862 -'&quot; . (int)$customer_id . &quot;' and products_id = '&quot; . tep_db_input($products_id)
  863 -. &quot;'&quot;);</span></p>
  864 -
  865 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  866 -color:blue'>&nbsp;</span></p>
  867 -
  868 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  869 -color:blue'>� if (is_array($attributes)) {</span></p>
  870 -
  871 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  872 -color:blue'>��� reset($attributes);</span></p>
  873 -
  874 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  875 -color:blue'>��� while (list($option, $value) = each($attributes)) {</span></p>
  876 -
  877 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  878 -color:blue'>����� $this-&gt;contents[$products_id]['attributes'][$option] =
  879 -$value;</span></p>
  880 -
  881 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  882 -color:blue'>// update database</span></p>
  883 -
  884 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  885 -color:blue'>����� if (tep_session_is_registered('customer_id')) tep_db_query(&quot;update
  886 -&quot; . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . &quot; set
  887 -products_options_value_id = '&quot; . (int)$value . &quot;' where customers_id
  888 -= '&quot; . (int)$customer_id . &quot;' and products_id = '&quot; .
  889 -tep_db_input($products_id) . &quot;' and products_options_id = '&quot; .
  890 -(int)$option . &quot;'&quot;);</span></p>
  891 -
  892 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  893 -color:blue'>��� }</span></p>
  894 -
  895 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  896 -color:blue'>� }</span></p>
  897 -
  898 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  899 -color:blue'>}</span></p>
  900 -
  901 -<p class=MsoNormal>&nbsp;</p>
  902 -
  903 -<p class=MsoNormal>to:</p>
  904 -
  905 -<p class=MsoNormal>&nbsp;</p>
  906 -
  907 -<pre><span style='font-size:9.0pt;color:blue'>function update_quantity($products_id, $quantity = '', $attributes = '') {</span></pre><pre><span
  908 -style='font-size:9.0pt;color:blue'>� global $customer_id;</span></pre><pre><span
  909 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  910 -style='font-size:9.0pt;color:blue'>� $products_id_string = tep_get_uprid($products_id, $attributes);</span></pre><pre><span
  911 -style='font-size:9.0pt;color:blue'>� $products_id = tep_get_prid($products_id_string);</span></pre><pre><span
  912 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  913 -style='font-size:9.0pt;color:blue'>� if (is_numeric($products_id) &amp;&amp; isset($this-&gt;contents[$products_id_string]) &amp;&amp; is_numeric($quantity)) {</span></pre><pre><span
  914 -style='font-size:9.0pt;color:blue'>��� $this-&gt;contents[$products_id_string] = array('qty' =&gt; $quantity);</span></pre><pre><span
  915 -style='font-size:9.0pt;color:blue'>// update database</span></pre><pre><span
  916 -style='font-size:9.0pt;color:blue'>��� if (tep_session_is_registered('customer_id')) tep_db_query(&quot;update &quot; . TABLE_CUSTOMERS_BASKET . &quot; set customers_basket_quantity = '&quot; . (int)$quantity . &quot;' where customers_id = '&quot; . (int)$customer_id . &quot;' and products_id = '&quot; . tep_db_input($products_id_string) . &quot;'&quot;);</span></pre><pre><span
  917 -style='font-size:9.0pt;color:blue'>&nbsp;</span></pre><pre><span
  918 -style='font-size:9.0pt;color:blue'>��� if (is_array($attributes)) {</span></pre><pre><span
  919 -style='font-size:9.0pt;color:blue'>����� reset($attributes);</span></pre><pre><span
  920 -style='font-size:9.0pt;color:blue'>����� while (list($option, $value) = each($attributes)) {</span></pre><pre><span
  921 -style='font-size:9.0pt;color:blue'>������� $this-&gt;contents[$products_id_string]['attributes'][$option] = $value;</span></pre><pre><span
  922 -style='font-size:9.0pt;color:blue'>// update database</span></pre><pre><span
  923 -style='font-size:9.0pt;color:blue'>������� if (tep_session_is_registered('customer_id')) tep_db_query(&quot;update &quot; . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . &quot; set products_options_value_id = '&quot; . (int)$value . &quot;' where customers_id = '&quot; . (int)$customer_id . &quot;' and products_id = '&quot; . tep_db_input($products_id_string) . &quot;' and products_options_id = '&quot; . (int)$option . &quot;'&quot;);</span></pre><pre><span
  924 -style='font-size:9.0pt;color:blue'>����� }</span></pre><pre><span
  925 -style='font-size:9.0pt;color:blue'>��� }</span></pre><pre><span
  926 -style='font-size:9.0pt;color:blue'>� }</span></pre><pre><span style='font-size:
  927 -9.0pt;color:blue'>}</span></pre><b><span style='font-size:16.0pt;font-family:
  928 -Arial'><br clear=all style='page-break-before:always'>
  929 -</span></b>
  930 -
  931 -<h1><a name="_Toc119693707"></a><a name="_Toc119693033">Session ID XSS Issue</a></h1>
  932 -
  933 -<p class=MsoNormal><a href="http://www.oscommerce.com/community/bugs,1546">http://www.oscommerce.com/community/bugs,1546</a></p>
  934 -
  935 -<p class=MsoNormal>&nbsp;</p>
  936 -
  937 -<h3>Problem:</h3>
  938 -
  939 -<p class=MsoNormal>&nbsp;</p>
  940 -
  941 -<p class=MsoNormal><span lang=EN>A cross site scripting issue exists with
  942 -malformed session IDs being used in the tep_href_link() function.</span></p>
  943 -
  944 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  945 -
  946 -<h3><span lang=EN>Solution:</span></h3>
  947 -
  948 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  949 -
  950 -<p class=MsoNormal><span lang=EN>Line 66 in
  951 -catalog/includes/functions/html_output.php must be changed from:</span></p>
  952 -
  953 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  954 -
  955 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  956 -color:blue'>$link .= $separator . <span style='background:yellow'>$_sid</span>;</span></p>
  957 -
  958 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  959 -
  960 -<p class=MsoNormal><span lang=EN>to:</span></p>
  961 -
  962 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  963 -
  964 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  965 -color:blue'>$link .= $separator . <span style='background:yellow'>tep_output_string($_sid)</span>;</span></p>
  966 -
  967 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  968 -
  969 -<b><span style='font-size:16.0pt;font-family:Arial'><br clear=all
  970 -style='page-break-before:always'>
  971 -</span></b>
  972 -
  973 -<h1><a name="_Toc119693708"></a><a name="_Toc119693034">Validate Session ID</a></h1>
  974 -
  975 -<p class=MsoNormal>&nbsp;</p>
  976 -
  977 -<h3>Problem:</h3>
  978 -
  979 -<p class=MsoNormal>&nbsp;</p>
  980 -
  981 -<p class=MsoNormal>Validate the session ID and redirect to the front page when an
  982 -invalid session ID is requested.</p>
  983 -
  984 -<p class=MsoNormal>&nbsp;</p>
  985 -
  986 -<h3>Solution:</h3>
  987 -
  988 -<p class=MsoNormal>&nbsp;</p>
  989 -
  990 -<p class=MsoNormal>The following function must be replaced in
  991 -catalog/includes/functions/sessions.php.</p>
  992 -
  993 -<p class=MsoNormal>&nbsp;</p>
  994 -
  995 -<p class=MsoNormal>Lines 66-68, from:</p>
  996 -
  997 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  998 -
  999 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1000 -color:blue'>function tep_session_start() {</span></p>
  1001 -
  1002 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1003 -color:blue'>� return session_start();</span></p>
  1004 -
  1005 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1006 -color:blue'>}</span></p>
  1007 -
  1008 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  1009 -
  1010 -<p class=MsoNormal><span lang=EN>to:</span></p>
  1011 -
  1012 -<p class=MsoNormal><span lang=EN>&nbsp;</span></p>
  1013 -
  1014 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1015 -color:blue'>function tep_session_start() {</span></p>
  1016 -
  1017 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1018 -color:blue'>� global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;</span></p>
  1019 -
  1020 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1021 -color:blue'>&nbsp;</span></p>
  1022 -
  1023 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1024 -color:blue'>� $sane_session_id = true;</span></p>
  1025 -
  1026 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1027 -color:blue'>&nbsp;</span></p>
  1028 -
  1029 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1030 -color:blue'>� if (isset($HTTP_GET_VARS[tep_session_name()])) {</span></p>
  1031 -
  1032 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1033 -color:blue'>��� if (preg_match('/^[a-zA-Z0-9]+$/',
  1034 -$HTTP_GET_VARS[tep_session_name()]) == false) {</span></p>
  1035 -
  1036 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1037 -color:blue'>����� unset($HTTP_GET_VARS[tep_session_name()]);</span></p>
  1038 -
  1039 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1040 -color:blue'>&nbsp;</span></p>
  1041 -
  1042 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1043 -color:blue'>����� $sane_session_id = false;</span></p>
  1044 -
  1045 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1046 -color:blue'>��� }</span></p>
  1047 -
  1048 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1049 -color:blue'>� } elseif (isset($HTTP_POST_VARS[tep_session_name()])) {</span></p>
  1050 -
  1051 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1052 -color:blue'>��� if (preg_match('/^[a-zA-Z0-9]+$/',
  1053 -$HTTP_POST_VARS[tep_session_name()]) == false) {</span></p>
  1054 -
  1055 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1056 -color:blue'>����� unset($HTTP_POST_VARS[tep_session_name()]);</span></p>
  1057 -
  1058 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1059 -color:blue'>&nbsp;</span></p>
  1060 -
  1061 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1062 -color:blue'>����� $sane_session_id = false;</span></p>
  1063 -
  1064 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1065 -color:blue'>��� }</span></p>
  1066 -
  1067 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1068 -color:blue'>� } elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {</span></p>
  1069 -
  1070 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1071 -color:blue'>��� if (preg_match('/^[a-zA-Z0-9]+$/',
  1072 -$HTTP_COOKIE_VARS[tep_session_name()]) == false) {</span></p>
  1073 -
  1074 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1075 -color:blue'>����� $session_data = session_get_cookie_params();</span></p>
  1076 -
  1077 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1078 -color:blue'>&nbsp;</span></p>
  1079 -
  1080 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1081 -color:blue'>����� setcookie(tep_session_name(), '', time()-42000,
  1082 -$session_data['path'], $session_data['domain']);</span></p>
  1083 -
  1084 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1085 -color:blue'>&nbsp;</span></p>
  1086 -
  1087 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1088 -color:blue'>����� $sane_session_id = false;</span></p>
  1089 -
  1090 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1091 -color:blue'>��� }</span></p>
  1092 -
  1093 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1094 -color:blue'>� }</span></p>
  1095 -
  1096 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1097 -color:blue'>&nbsp;</span></p>
  1098 -
  1099 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1100 -color:blue'>� if ($sane_session_id == false) {</span></p>
  1101 -
  1102 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1103 -color:blue'>��� tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL',
  1104 -false));</span></p>
  1105 -
  1106 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1107 -color:blue'>� }</span></p>
  1108 -
  1109 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1110 -color:blue'>&nbsp;</span></p>
  1111 -
  1112 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1113 -color:blue'>� return session_start();</span></p>
  1114 -
  1115 -<p class=MsoNormal><span lang=EN style='font-size:9.0pt;font-family:"Courier New";
  1116 -color:blue'>}</span></p>
  1117 -
  1118 -<b><span lang=EN style='font-size:9.0pt;font-family:Arial;color:blue'><br
  1119 -clear=all style='page-break-before:always'>
  1120 -</span></b>
  1121 -
  1122 -<h1><a name="_Toc119693709"></a><a name="_Toc119693035">File Manager Problem</a></h1>
  1123 -
  1124 -<p class=MsoNormal><a href="http://www.oscommerce.com/community/bugs,1391">http://www.oscommerce.com/community/bugs,1391</a></p>
  1125 -
  1126 -<p class=MsoNormal>&nbsp;</p>
  1127 -
  1128 -<h3>Problem:</h3>
  1129 -
  1130 -<p class=MsoNormal>&nbsp;</p>
  1131 -
  1132 -<p class=MsoNormal>Parsing errors occur when saving edited files through the
  1133 -File Manager.</p>
  1134 -
  1135 -<p class=MsoNormal>&nbsp;</p>
  1136 -
  1137 -<h3>Solution:</h3>
  1138 -
  1139 -<p class=MsoNormal>&nbsp;</p>
  1140 -
  1141 -<p class=MsoNormal>Line 148 in catalog/admin/file_manager.php must be changed
  1142 -from:</p>
  1143 -
  1144 -<p class=MsoNormal>&nbsp;</p>
  1145 -
  1146 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1147 -color:blue'>$file_contents = <span style='background:yellow'>htmlspecialchars(implode('',
  1148 -$file_array))</span>;</span></p>
  1149 -
  1150 -<p class=MsoNormal>&nbsp;</p>
  1151 -
  1152 -<p class=MsoNormal>to:</p>
  1153 -
  1154 -<p class=MsoNormal>&nbsp;</p>
  1155 -
  1156 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1157 -color:blue'>$file_contents = <span style='background:yellow'>addslashes(implode('',
  1158 -$file_array))</span>;</span></p>
  1159 -
  1160 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1161 -color:blue'>&nbsp;</span></p>
  1162 -
  1163 -<p class=MsoNormal>Note: This update also requires the Contact Us Form XSS
  1164 -Issue update in order to function correctly.<span style='font-size:9.0pt;
  1165 -color:blue'><br clear=all style='page-break-before:always'>
  1166 -</span><a name="_Toc119693710"></a><a name="_Toc119693036"><span
  1167 -class=Heading1Char><span style='font-size:16.0pt'>HTTP Header Injection</span></span></a></p>
  1168 -
  1169 -<p class=MsoNormal>&nbsp;</p>
  1170 -
  1171 -<h3>Problem:</h3>
  1172 -
  1173 -<p class=MsoNormal>&nbsp;</p>
  1174 -
  1175 -<p class=MsoNormal><span lang=EN>By using malicious data it is possible to
  1176 -inject headers into HTTP requests.</span> </p>
  1177 -
  1178 -<h3>Solution:</h3>
  1179 -
  1180 -<p class=MsoNormal>&nbsp;</p>
  1181 -
  1182 -<p class=MsoNormal>The following function must be replaced in
  1183 -catalog/includes/functions/general.php.</p>
  1184 -
  1185 -<p class=MsoNormal>&nbsp;</p>
  1186 -
  1187 -<p class=MsoNormal>Lines 22-32, from:</p>
  1188 -
  1189 -<p class=MsoNormal>&nbsp;</p>
  1190 -
  1191 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1192 -color:blue'>function tep_redirect($url) {</span></p>
  1193 -
  1194 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1195 -color:blue'>� if ( (ENABLE_SSL == true) &amp;&amp; (getenv('HTTPS') == 'on') )
  1196 -{ // We are loading an SSL page</span></p>
  1197 -
  1198 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1199 -color:blue'>��� if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { //
  1200 -NONSSL url</span></p>
  1201 -
  1202 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1203 -color:blue'>����� $url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); //
  1204 -Change it to SSL</span></p>
  1205 -
  1206 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1207 -color:blue'>��� }</span></p>
  1208 -
  1209 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1210 -color:blue'>� }</span></p>
  1211 -
  1212 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1213 -color:blue'>&nbsp;</span></p>
  1214 -
  1215 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1216 -color:blue'>� header('Location: ' . $url);</span></p>
  1217 -
  1218 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1219 -color:blue'>&nbsp;</span></p>
  1220 -
  1221 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1222 -color:blue'>� tep_exit();</span></p>
  1223 -
  1224 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1225 -color:blue'>}</span></p>
  1226 -
  1227 -<p class=MsoNormal>&nbsp;</p>
  1228 -
  1229 -<p class=MsoNormal>to:</p>
  1230 -
  1231 -<p class=MsoNormal>&nbsp;</p>
  1232 -
  1233 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1234 -color:blue'>function tep_redirect($url) {</span></p>
  1235 -
  1236 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1237 -color:blue'>� if ( (strstr($url, &quot;\n&quot;) != false) || (strstr($url,
  1238 -&quot;\r&quot;) != false) ) {</span></p>
  1239 -
  1240 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1241 -color:blue'>��� tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL',
  1242 -false));</span></p>
  1243 -
  1244 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1245 -color:blue'>� }</span></p>
  1246 -
  1247 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1248 -color:blue'>&nbsp;</span></p>
  1249 -
  1250 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1251 -color:blue'>� if ( (ENABLE_SSL == true) &amp;&amp; (getenv('HTTPS') == 'on') )
  1252 -{ // We are loading an SSL page</span></p>
  1253 -
  1254 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1255 -color:blue'>��� if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { //
  1256 -NONSSL url</span></p>
  1257 -
  1258 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1259 -color:blue'>����� $url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); //
  1260 -Change it to SSL</span></p>
  1261 -
  1262 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1263 -color:blue'>��� }</span></p>
  1264 -
  1265 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1266 -color:blue'>��}</span></p>
  1267 -
  1268 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1269 -color:blue'>&nbsp;</span></p>
  1270 -
  1271 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1272 -color:blue'>� header('Location: ' . $url);</span></p>
  1273 -
  1274 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1275 -color:blue'>&nbsp;</span></p>
  1276 -
  1277 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1278 -color:blue'>� tep_exit();</span></p>
  1279 -
  1280 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1281 -color:blue'>}</span></p>
  1282 -
  1283 -<span style='font-size:9.0pt;font-family:"Courier New";color:blue'><br
  1284 -clear=all style='page-break-before:always'>
  1285 -</span>
  1286 -
  1287 -<p class=MsoNormal>The following function must be replaced in
  1288 -catalog/admin/includes/functions/general.php.</p>
  1289 -
  1290 -<p class=MsoNormal>&nbsp;</p>
  1291 -
  1292 -<p class=MsoNormal>Lines 15-26, from:</p>
  1293 -
  1294 -<p class=MsoNormal>&nbsp;</p>
  1295 -
  1296 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1297 -color:blue'>function tep_redirect($url) {</span></p>
  1298 -
  1299 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1300 -color:blue'>� global $logger;</span></p>
  1301 -
  1302 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1303 -color:blue'>&nbsp;</span></p>
  1304 -
  1305 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1306 -color:blue'>� header('Location: ' . $url);</span></p>
  1307 -
  1308 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1309 -color:blue'>&nbsp;</span></p>
  1310 -
  1311 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1312 -color:blue'>� if (STORE_PAGE_PARSE_TIME == 'true') {</span></p>
  1313 -
  1314 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1315 -color:blue'>��� if (!is_object($logger)) $logger = new logger;</span></p>
  1316 -
  1317 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1318 -color:blue'>��� $logger-&gt;timer_stop();</span></p>
  1319 -
  1320 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1321 -color:blue'>� }</span></p>
  1322 -
  1323 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1324 -color:blue'>&nbsp;</span></p>
  1325 -
  1326 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1327 -color:blue'>� exit;</span></p>
  1328 -
  1329 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1330 -color:blue'>}</span></p>
  1331 -
  1332 -<p class=MsoNormal><span style='font-size:9.0pt;color:blue'>&nbsp;</span></p>
  1333 -
  1334 -<p class=MsoNormal>to:</p>
  1335 -
  1336 -<p class=MsoNormal><span style='font-size:9.0pt;color:blue'>&nbsp;</span></p>
  1337 -
  1338 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1339 -color:blue'>function tep_redirect($url) {</span></p>
  1340 -
  1341 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1342 -color:blue'>� global $logger;</span></p>
  1343 -
  1344 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1345 -color:blue'>&nbsp;</span></p>
  1346 -
  1347 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1348 -color:blue'>� if ( (strstr($url, &quot;\n&quot;) != false) || (strstr($url,
  1349 -&quot;\r&quot;) != false) ) {</span></p>
  1350 -
  1351 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1352 -color:blue'>��� tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL',
  1353 -false));</span></p>
  1354 -
  1355 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1356 -color:blue'>� }</span></p>
  1357 -
  1358 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1359 -color:blue'>&nbsp;</span></p>
  1360 -
  1361 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1362 -color:blue'>� header('Location: ' . $url);</span></p>
  1363 -
  1364 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1365 -color:blue'>&nbsp;</span></p>
  1366 -
  1367 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1368 -color:blue'>� if (STORE_PAGE_PARSE_TIME == 'true') {</span></p>
  1369 -
  1370 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1371 -color:blue'>��� if (!is_object($logger)) $logger = new logger;</span></p>
  1372 -
  1373 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1374 -color:blue'>��� $logger-&gt;timer_stop();</span></p>
  1375 -
  1376 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1377 -color:blue'>� }</span></p>
  1378 -
  1379 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1380 -color:blue'>&nbsp;</span></p>
  1381 -
  1382 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1383 -color:blue'>� exit;</span></p>
  1384 -
  1385 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1386 -color:blue'>}</span><span style='font-size:9.0pt;color:blue'><br clear=all
  1387 -style='page-break-before:always'>
  1388 -</span><a name="_Toc119693711"></a><a name="_Toc119693037"><span
  1389 -class=Heading1Char><span style='font-size:16.0pt'>E-Mail Header Injection</span></span></a></p>
  1390 -
  1391 -<p class=MsoNormal><a href="http://www.oscommerce.com/community/bugs,2488">http://www.oscommerce.com/community/bugs,2488</a></p>
  1392 -
  1393 -<p class=MsoNormal>&nbsp;</p>
  1394 -
  1395 -<h3>Problem:</h3>
  1396 -
  1397 -<p class=MsoNormal>&nbsp;</p>
  1398 -
  1399 -<p class=MsoNormal><span lang=EN>By using malicious data it is possible to
  1400 -inject headers into emails the online store sends.</span><span lang=EN> </span></p>
  1401 -
  1402 -<p class=MsoNormal>&nbsp;</p>
  1403 -
  1404 -<h3>Solution:</h3>
  1405 -
  1406 -<p class=MsoNormal>&nbsp;</p>
  1407 -
  1408 -<p class=MsoNormal>The following function must be replaced in catalog/includes/classes/email.php
  1409 -and catalog/admin/includes/classes/email.php.</p>
  1410 -
  1411 -<p class=MsoNormal>&nbsp;</p>
  1412 -
  1413 -<p class=MsoNormal>Lines 473-504, from:</p>
  1414 -
  1415 -<p class=MsoNormal>&nbsp;</p>
  1416 -
  1417 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1418 -color:blue'>function send($to_name, $to_addr, $from_name, $from_addr, $subject
  1419 -= '', $headers = '') {</span></p>
  1420 -
  1421 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1422 -color:blue'>� $to = (($to_name != '') ? '&quot;' . $to_name . '&quot; &lt;' .
  1423 -$to_addr . '&gt;' : $to_addr);</span></p>
  1424 -
  1425 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1426 -color:blue'>� $from = (($from_name != '') ? '&quot;' . $from_name . '&quot;
  1427 -&lt;' . $from_addr . '&gt;' : $from_addr);</span></p>
  1428 -
  1429 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1430 -color:blue'>&nbsp;</span></p>
  1431 -
  1432 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1433 -color:blue'>� if (is_string($headers)) {</span></p>
  1434 -
  1435 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1436 -color:blue'>��� $headers = explode($this-&gt;lf, trim($headers));</span></p>
  1437 -
  1438 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1439 -color:blue'>� }</span></p>
  1440 -
  1441 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1442 -color:blue'>&nbsp;</span></p>
  1443 -
  1444 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1445 -color:blue'>� for ($i=0; $i&lt;count($headers); $i++) {</span></p>
  1446 -
  1447 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1448 -color:blue'>��� if (is_array($headers[$i])) {</span></p>
  1449 -
  1450 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1451 -color:blue'>����� for ($j=0; $j&lt;count($headers[$i]); $j++) {</span></p>
  1452 -
  1453 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1454 -color:blue'>������� if ($headers[$i][$j] != '') {</span></p>
  1455 -
  1456 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1457 -color:blue'>��������� $xtra_headers[] = $headers[$i][$j];</span></p>
  1458 -
  1459 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1460 -color:blue'>������� }</span></p>
  1461 -
  1462 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1463 -color:blue'>����� }</span></p>
  1464 -
  1465 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1466 -color:blue'>��� }</span></p>
  1467 -
  1468 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1469 -color:blue'>&nbsp;</span></p>
  1470 -
  1471 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1472 -color:blue'>��� if ($headers[$i] != '') {</span></p>
  1473 -
  1474 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1475 -color:blue'>����� $xtra_headers[] = $headers[$i];</span></p>
  1476 -
  1477 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1478 -color:blue'>��� }</span></p>
  1479 -
  1480 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1481 -color:blue'>� }</span></p>
  1482 -
  1483 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1484 -color:blue'>&nbsp;</span></p>
  1485 -
  1486 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1487 -color:blue'>� if (!isset($xtra_headers)) {</span></p>
  1488 -
  1489 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1490 -color:blue'>��� $xtra_headers = array();</span></p>
  1491 -
  1492 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1493 -color:blue'>� }</span></p>
  1494 -
  1495 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1496 -color:blue'>&nbsp;</span></p>
  1497 -
  1498 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1499 -color:blue'>� if (EMAIL_TRANSPORT == 'smtp') {</span></p>
  1500 -
  1501 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1502 -color:blue'>��� return mail($to_addr, $subject, $this-&gt;output, 'From: ' .
  1503 -$from . $this-&gt;lf . 'To: ' . $to . $this-&gt;lf . implode($this-&gt;lf,
  1504 -$this-&gt;headers) . $this-&gt;lf . implode($this-&gt;lf, $xtra_headers));</span></p>
  1505 -
  1506 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1507 -color:blue'>� } else {</span></p>
  1508 -
  1509 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1510 -color:blue'>��� return mail($to, $subject, $this-&gt;output, 'From:
  1511 -'.$from.$this-&gt;lf.implode($this-&gt;lf,
  1512 -$this-&gt;headers).$this-&gt;lf.implode($this-&gt;lf, $xtra_headers));</span></p>
  1513 -
  1514 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1515 -color:blue'>� }</span></p>
  1516 -
  1517 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1518 -color:blue'>}</span></p>
  1519 -
  1520 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1521 -color:blue'>&nbsp;</span></p>
  1522 -
  1523 -<p class=MsoNormal>to:</p>
  1524 -
  1525 -<p class=MsoNormal>&nbsp;</p>
  1526 -
  1527 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1528 -color:blue'>function send($to_name, $to_addr, $from_name, $from_addr, $subject
  1529 -= '', $headers = '') {<br>
  1530 -� <span style='background:yellow'>if ((strstr($to_name, &quot;\n&quot;) !=
  1531 -false) || (strstr($to_name, &quot;\r&quot;) != false)) {</span></span></p>
  1532 -
  1533 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1534 -color:blue;background:yellow'>��� return false;<br>
  1535 -� }<br>
  1536 -<br>
  1537 -� if ((strstr($to_addr, &quot;\n&quot;) != false) || (strstr($to_addr,
  1538 -&quot;\r&quot;) != false)) {<br>
  1539 -��� return false;<br>
  1540 -� }<br>
  1541 -<br>
  1542 -� if ((strstr($subject, &quot;\n&quot;) != false) || (strstr($subject,
  1543 -&quot;\r&quot;) != false)) {<br>
  1544 -��� return false;<br>
  1545 -� }<br>
  1546 -<br>
  1547 -� if ((strstr($from_name, &quot;\n&quot;) != false) || (strstr($from_name,
  1548 -&quot;\r&quot;) != false)) {<br>
  1549 -��� return false;<br>
  1550 -� }<br>
  1551 -<br>
  1552 -� if ((strstr($from_addr, &quot;\n&quot;) != false) || (strstr($from_addr,
  1553 -&quot;\r&quot;) != false)) {<br>
  1554 -��� return false;<br>
  1555 -� }</span><span style='font-size:9.0pt;font-family:"Courier New";color:blue'><br>
  1556 -<br>
  1557 -� $to = (($to_name != '') ? '&quot;' . $to_name . '&quot; &lt;' . $to_addr .
  1558 -'&gt;' : $to_addr);<br>
  1559 -� $from = (($from_name != '') ? '&quot;' . $from_name . '&quot; &lt;' . $from_addr
  1560 -. '&gt;' : $from_addr);<br>
  1561 -<br>
  1562 -� if (is_string($headers)) {<br>
  1563 -��� $headers = explode($this-&gt;lf, trim($headers));<br>
  1564 -� }<br>
  1565 -<br>
  1566 -� for ($i=0; $i&lt;count($headers); $i++) {<br>
  1567 -��� if (is_array($headers[$i])) {<br>
  1568 -����� for ($j=0; $j&lt;count($headers[$i]); $j++) {<br>
  1569 -������� if ($headers[$i][$j] != '') {<br>
  1570 -��������� $xtra_headers[] = $headers[$i][$j];<br>
  1571 -������� }<br>
  1572 -����� }<br>
  1573 -��� }<br>
  1574 -<br>
  1575 -��� if ($headers[$i] != '') {<br>
  1576 -����� $xtra_headers[] = $headers[$i];<br>
  1577 -��� }<br>
  1578 -� }<br>
  1579 -<br>
  1580 -� if (!isset($xtra_headers)) {<br>
  1581 -��� $xtra_headers = array();<br>
  1582 -� }<br>
  1583 -<br>
  1584 -� if (EMAIL_TRANSPORT == 'smtp') {<br>
  1585 -��� return mail($to_addr, $subject, $this-&gt;output, 'From: ' . $from .
  1586 -$this-&gt;lf . 'To: ' . $to . $this-&gt;lf . implode($this-&gt;lf,
  1587 -$this-&gt;headers) . $this-&gt;lf . implode($this-&gt;lf, $xtra_headers));<br>
  1588 -� } else {<br>
  1589 -��� return mail($to, $subject, $this-&gt;output, 'From:
  1590 -'.$from.$this-&gt;lf.implode($this-&gt;lf, $this-&gt;headers).$this-&gt;lf.implode($this-&gt;lf,
  1591 -$xtra_headers));<br>
  1592 -� }<br>
  1593 -}</span></p>
  1594 -
  1595 -<b><span style='font-size:16.0pt;font-family:Arial'><br clear=all
  1596 -style='page-break-before:always'>
  1597 -</span></b>
  1598 -
  1599 -<h1><a name="_Toc119693712"></a><a name="_Toc119693038">Contact Us Form XSS
  1600 -Issue</a></h1>
  1601 -
  1602 -<p class=MsoNormal><a href="http://www.oscommerce.com/community/bugs,2422">http://www.oscommerce.com/community/bugs,2422</a></p>
  1603 -
  1604 -<p class=MsoNormal>&nbsp;</p>
  1605 -
  1606 -<h3>Problem:</h3>
  1607 -
  1608 -<p class=MsoNormal>&nbsp;</p>
  1609 -
  1610 -<p class=MsoNormal><span lang=EN>By using malicious data it is possible to
  1611 -inject HTML into the page.</span> </p>
  1612 -
  1613 -<p class=MsoNormal>&nbsp;</p>
  1614 -
  1615 -<h3>Solution:</h3>
  1616 -
  1617 -<p class=MsoNormal>&nbsp;</p>
  1618 -
  1619 -<p class=MsoNormal>Lines 221-225 in catalog/includes/functions/html_output.php
  1620 -must be changed from:</p>
  1621 -
  1622 -<p class=MsoNormal>&nbsp;</p>
  1623 -
  1624 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1625 -color:blue'>if ( (isset($GLOBALS[$name])) &amp;&amp; ($reinsert_value == true)
  1626 -) {</span></p>
  1627 -
  1628 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1629 -color:blue'>� $field .= <span style='background:yellow'>stripslashes($GLOBALS[$name])</span>;</span></p>
  1630 -
  1631 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1632 -color:blue'>} elseif (tep_not_null($text)) {</span></p>
  1633 -
  1634 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1635 -color:blue'>� $field .= <span style='background:yellow'>$text</span>;</span></p>
  1636 -
  1637 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1638 -color:blue'>}</span></p>
  1639 -
  1640 -<p class=MsoNormal>&nbsp;</p>
  1641 -
  1642 -<p class=MsoNormal>to:</p>
  1643 -
  1644 -<p class=MsoNormal>&nbsp;</p>
  1645 -
  1646 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1647 -color:blue'>if ( (isset($GLOBALS[$name])) &amp;&amp; ($reinsert_value == true)
  1648 -) {</span></p>
  1649 -
  1650 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1651 -color:blue'>� $field .= <span style='background:yellow'>tep_output_string_protected(stripslashes($GLOBALS[$name]))</span>;</span></p>
  1652 -
  1653 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1654 -color:blue'>} elseif (tep_not_null($text)) {</span></p>
  1655 -
  1656 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1657 -color:blue'>� $field .= <span style='background:yellow'>tep_output_string_protected($text)</span>;</span></p>
  1658 -
  1659 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1660 -color:blue'>}</span></p>
  1661 -
  1662 -<p class=MsoNormal>&nbsp;</p>
  1663 -
  1664 -<p class=MsoNormal>Lines 244-248 in
  1665 -catalog/admin/includes/functions/html_output.php must be changed from:</p>
  1666 -
  1667 -<p class=MsoNormal>&nbsp;</p>
  1668 -
  1669 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1670 -color:blue'>if ( (isset($GLOBALS[$name])) &amp;&amp; ($reinsert_value == true)
  1671 -) {</span></p>
  1672 -
  1673 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1674 -color:blue'>� $field .= <span style='background:yellow'>stripslashes($GLOBALS[$name])</span>;</span></p>
  1675 -
  1676 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1677 -color:blue'>} elseif (tep_not_null($text)) {</span></p>
  1678 -
  1679 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1680 -color:blue'>� $field .= <span style='background:yellow'>$text</span>;</span></p>
  1681 -
  1682 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1683 -color:blue'>}</span></p>
  1684 -
  1685 -<p class=MsoNormal>&nbsp;</p>
  1686 -
  1687 -<p class=MsoNormal>to:</p>
  1688 -
  1689 -<p class=MsoNormal>&nbsp;</p>
  1690 -
  1691 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1692 -color:blue'>if ( (isset($GLOBALS[$name])) &amp;&amp; ($reinsert_value == true)
  1693 -) {</span></p>
  1694 -
  1695 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1696 -color:blue'>� $field .= <span style='background:yellow'>tep_output_string_protected(stripslashes($GLOBALS[$name]))</span>;</span></p>
  1697 -
  1698 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1699 -color:blue'>} elseif (tep_not_null($text)) {</span></p>
  1700 -
  1701 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1702 -color:blue'>� $field .= <span style='background:yellow'>tep_output_string_protected($text)</span>;</span></p>
  1703 -
  1704 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1705 -color:blue'>}</span></p>
  1706 -
  1707 -<b><span style='font-size:16.0pt;font-family:Arial'><br clear=all
  1708 -style='page-break-before:always'>
  1709 -</span></b>
  1710 -
  1711 -<h1><a name="_Toc119693713"></a><a name="_Toc119693039">Open Redirector</a></h1>
  1712 -
  1713 -<p class=MsoNormal><a href="http://www.oscommerce.com/community/bugs,2970">http://www.oscommerce.com/community/bugs,2970</a></p>
  1714 -
  1715 -<p class=MsoNormal>&nbsp;</p>
  1716 -
  1717 -<h3>Problem:</h3>
  1718 -
  1719 -<p class=MsoNormal>&nbsp;</p>
  1720 -
  1721 -<p class=MsoNormal>There is no URL checking being performed on the redirection
  1722 -page, and allows external sources to use the page as an open redirect relay.</p>
  1723 -
  1724 -<p class=MsoNormal>&nbsp;</p>
  1725 -
  1726 -<h3>Solution:</h3>
  1727 -
  1728 -<p class=MsoNormal>&nbsp;</p>
  1729 -
  1730 -<p class=MsoNormal>Lines 27-29 in catalog/redirect.php must be changed from:</p>
  1731 -
  1732 -<p class=MsoNormal>&nbsp;</p>
  1733 -
  1734 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1735 -color:blue'>if (isset($HTTP_GET_VARS['goto']) &amp;&amp;
  1736 -tep_not_null($HTTP_GET_VARS['goto'])) {</span></p>
  1737 -
  1738 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1739 -color:blue'>� tep_redirect('http://' . $HTTP_GET_VARS['goto']);</span></p>
  1740 -
  1741 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1742 -color:blue'>}</span></p>
  1743 -
  1744 -<p class=MsoNormal>&nbsp;</p>
  1745 -
  1746 -<p class=MsoNormal>to:</p>
  1747 -
  1748 -<p class=MsoNormal>&nbsp;</p>
  1749 -
  1750 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1751 -color:blue'>if (isset($HTTP_GET_VARS['goto']) &amp;&amp; tep_not_null($HTTP_GET_VARS['goto']))
  1752 -{</span></p>
  1753 -
  1754 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1755 -color:blue'>� $check_query = tep_db_query(&quot;select products_url from &quot;
  1756 -. TABLE_PRODUCTS_DESCRIPTION . &quot; where products_url = '&quot; .
  1757 -tep_db_input($HTTP_GET_VARS['goto']) . &quot;' limit 1&quot;);</span></p>
  1758 -
  1759 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1760 -color:blue'>� if (tep_db_num_rows($check_query)) {</span></p>
  1761 -
  1762 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1763 -color:blue'>��� tep_redirect('http://' . $HTTP_GET_VARS['goto']);</span></p>
  1764 -
  1765 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1766 -color:blue'>� }</span></p>
  1767 -
  1768 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1769 -color:blue'>}</span></p>
  1770 -
  1771 -<b><span style='font-size:16.0pt;font-family:Arial'><br clear=all
  1772 -style='page-break-before:always'>
  1773 -</span></b>
  1774 -
  1775 -<h1><a name="_Toc119693714"></a><a name="_Toc119693040">Extra Slashes In New
  1776 -Products</a></h1>
  1777 -
  1778 -<p class=MsoNormal>&nbsp;</p>
  1779 -
  1780 -<h3>Problem:</h3>
  1781 -
  1782 -<p class=MsoNormal>&nbsp;</p>
  1783 -
  1784 -<p class=MsoNormal>When new products are entered and previewed, hitting the
  1785 -back button to edit the product data again adds extra slashes to apostrophes in
  1786 -the products name and description.</p>
  1787 -
  1788 -<p class=MsoNormal>&nbsp;</p>
  1789 -
  1790 -<h3>Solution:</h3>
  1791 -
  1792 -<p class=MsoNormal>&nbsp;</p>
  1793 -
  1794 -<p class=MsoNormal>The following lines must be replaced in catalog/admin/categories.php:</p>
  1795 -
  1796 -<p class=MsoNormal>&nbsp;</p>
  1797 -
  1798 -<p class=MsoNormal>Line 504, from:</p>
  1799 -
  1800 -<p class=MsoNormal>&nbsp;</p>
  1801 -
  1802 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1803 -color:blue'>&lt;td class=&quot;main&quot;&gt;&lt;?php echo
  1804 -tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' .
  1805 -$languages[$i]['image'], $languages[$i]['name']) . '&amp;nbsp;' .
  1806 -tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']',
  1807 -(isset($products_name[$languages[$i]['id']]) ? <span style='background:yellow'>$products_name[$languages[$i]['id']]</span>
  1808 -: tep_get_products_name($pInfo-&gt;products_id, $languages[$i]['id'])));
  1809 -?&gt;&lt;/td&gt;</span></p>
  1810 -
  1811 -<p class=MsoNormal>&nbsp;</p>
  1812 -
  1813 -<p class=MsoNormal>to:</p>
  1814 -
  1815 -<p class=MsoNormal>&nbsp;</p>
  1816 -
  1817 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1818 -color:blue'>&lt;td class=&quot;main&quot;&gt;&lt;?php echo
  1819 -tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' .
  1820 -$languages[$i]['image'], $languages[$i]['name']) . '&amp;nbsp;' .
  1821 -tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']',
  1822 -(isset($products_name[$languages[$i]['id']]) ? <span style='background:yellow'>stripslashes($products_name[$languages[$i]['id']])</span>
  1823 -: tep_get_products_name($pInfo-&gt;products_id, $languages[$i]['id'])));
  1824 -?&gt;&lt;/td&gt;</span></p>
  1825 -
  1826 -<p class=MsoNormal>&nbsp;</p>
  1827 -
  1828 -<p class=MsoNormal>Line 538, from:</p>
  1829 -
  1830 -<p class=MsoNormal>&nbsp;</p>
  1831 -
  1832 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1833 -color:blue'>&lt;td class=&quot;main&quot;&gt;&lt;?php echo
  1834 -tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']',
  1835 -'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? <span
  1836 -style='background:yellow'>$products_description[$languages[$i]['id']]</span> :
  1837 -tep_get_products_description($pInfo-&gt;products_id, $languages[$i]['id'])));
  1838 -?&gt;&lt;/td&gt;</span></p>
  1839 -
  1840 -<p class=MsoNormal>&nbsp;</p>
  1841 -
  1842 -<p class=MsoNormal>to:</p>
  1843 -
  1844 -<p class=MsoNormal>&nbsp;</p>
  1845 -
  1846 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1847 -color:blue'>&lt;td class=&quot;main&quot;&gt;&lt;?php echo tep_draw_textarea_field('products_description['
  1848 -. $languages[$i]['id'] . ']', 'soft', '70', '15',
  1849 -(isset($products_description[$languages[$i]['id']]) ? <span style='background:
  1850 -yellow'>stripslashes($products_description[$languages[$i]['id']])</span> :
  1851 -tep_get_products_description($pInfo-&gt;products_id, $languages[$i]['id'])));
  1852 -?&gt;&lt;/td&gt;</span></p>
  1853 -
  1854 -<span style='font-size:12.0pt;font-family:"Times New Roman"'><br clear=all
  1855 -style='page-break-before:always'>
  1856 -</span>
  1857 -
  1858 -<p class=MsoNormal>Line 574, from:</p>
  1859 -
  1860 -<p class=MsoNormal>&nbsp;</p>
  1861 -
  1862 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1863 -color:blue'>&lt;td class=&quot;main&quot;&gt;&lt;?php echo
  1864 -tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' .
  1865 -$languages[$i]['image'], $languages[$i]['name']) . '&amp;nbsp;' .
  1866 -tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']',
  1867 -(isset($products_url[$languages[$i]['id']]) ? <span style='background:yellow'>$products_url[$languages[$i]['id']]</span>
  1868 -: tep_get_products_url($pInfo-&gt;products_id, $languages[$i]['id'])));
  1869 -?&gt;&lt;/td&gt;</span></p>
  1870 -
  1871 -<p class=MsoNormal>&nbsp;</p>
  1872 -
  1873 -<p class=MsoNormal>to:</p>
  1874 -
  1875 -<p class=MsoNormal>&nbsp;</p>
  1876 -
  1877 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1878 -color:blue'>&lt;td class=&quot;main&quot;&gt;&lt;?php echo
  1879 -tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' .
  1880 -$languages[$i]['image'], $languages[$i]['name']) . '&amp;nbsp;' .
  1881 -tep_draw_input_field('products_url[' . $languages[$i]['id'] . ']',
  1882 -(isset($products_url[$languages[$i]['id']]) ? <span style='background:yellow'>stripslashes($products_url[$languages[$i]['id']])</span>
  1883 -: tep_get_products_url($pInfo-&gt;products_id, $languages[$i]['id'])));
  1884 -?&gt;&lt;/td&gt;</span></p>
  1885 -
  1886 -<b><span style='font-size:16.0pt;font-family:Arial'><br clear=all
  1887 -style='page-break-before:always'>
  1888 -</span></b>
  1889 -
  1890 -<h1><a name="_Toc119693715"></a><a name="_Toc119693041">Order Status Filtering</a></h1>
  1891 -
  1892 -<p class=MsoNormal><a href="http://www.oscommerce.com/community/bugs,1543">http://www.oscommerce.com/community/bugs,1543</a></p>
  1893 -
  1894 -<p class=MsoNormal>&nbsp;</p>
  1895 -
  1896 -<h3>Problem:</h3>
  1897 -
  1898 -<p class=MsoNormal>&nbsp;</p>
  1899 -
  1900 -<p class=MsoNormal>After changing the order status filtering on the
  1901 -Administration Tool -&gt; Customers -&gt; Orders page, selecting &quot;All
  1902 -Orders&quot; would show an empty listing of orders.</p>
  1903 -
  1904 -<p class=MsoNormal>&nbsp;</p>
  1905 -
  1906 -<h3>Solution:</h3>
  1907 -
  1908 -<p class=MsoNormal>&nbsp;</p>
  1909 -
  1910 -<p class=MsoNormal>Line 357 in catalog/admin/orders.php must be changed from:</p>
  1911 -
  1912 -<p class=MsoNormal>&nbsp;</p>
  1913 -
  1914 -<p class=NormalCourierNew><span style='font-size:9.0pt;font-family:"Courier New";
  1915 -color:blue'>} elseif (isset($HTTP_GET_VARS['status'])) {</span></p>
  1916 -
  1917 -<p class=MsoNormal>&nbsp;</p>
  1918 -
  1919 -<p class=MsoNormal>to:</p>
  1920 -
  1921 -<p class=MsoNormal>&nbsp;</p>
  1922 -
  1923 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1924 -color:blue'>} elseif (isset($HTTP_GET_VARS['status']) <span style='background:
  1925 -yellow'>&amp;&amp; is_numeric($HTTP_GET_VARS['status']) &amp;&amp;
  1926 -($HTTP_GET_VARS['status'] &gt; 0)</span>) {</span></p>
  1927 -
  1928 -<b><span style='font-size:16.0pt;font-family:Arial'><br clear=all
  1929 -style='page-break-before:always'>
  1930 -</span></b>
  1931 -
  1932 -<h1><a name="_Toc119693716"></a><a name="_Toc119693042">MySQL 5.0 Compatibility</a></h1>
  1933 -
  1934 -<p class=MsoNormal>&nbsp;</p>
  1935 -
  1936 -<h3>Problem:</h3>
  1937 -
  1938 -<p class=MsoNormal>&nbsp;</p>
  1939 -
  1940 -<p class=MsoNormal>MySQL 5.0 introduces Server SQL modes as part of its SQL
  1941 -2003 standards support, and uses a more stricter approach to executing SQL
  1942 -queries. This is performed by default with setting STRICT_TRANS_TABLES as a
  1943 -Server SQL mode.</p>
  1944 -
  1945 -<p class=MsoNormal>&nbsp;</p>
  1946 -
  1947 -<p class=MsoNormal>Due to this new setting, MySQL fails on certain SQL queries
  1948 -and produces error messages on the screen.</p>
  1949 -
  1950 -<p class=MsoNormal>&nbsp;</p>
  1951 -
  1952 -<h3>Solution:</h3>
  1953 -
  1954 -<p class=MsoNormal>&nbsp;</p>
  1955 -
  1956 -<p class=MsoNormal>Lines 213-223 in catalog/advanced_search_result.php must be
  1957 -changed from:</p>
  1958 -
  1959 -<p class=MsoNormal>&nbsp;</p>
  1960 -
  1961 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1962 -color:blue'>$from_str = &quot;from &quot; . TABLE_PRODUCTS . &quot; p left join
  1963 -&quot; . TABLE_MANUFACTURERS . &quot; m using(manufacturers_id) left join
  1964 -&quot; . TABLE_SPECIALS . &quot; s on p.products_id = s.products_id, &quot; .
  1965 -TABLE_PRODUCTS_DESCRIPTION . &quot; pd, &quot; . TABLE_CATEGORIES . &quot; c,
  1966 -&quot; . TABLE_PRODUCTS_TO_CATEGORIES . &quot; p2c&quot;;</span></p>
  1967 -
  1968 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1969 -color:blue'>&nbsp;</span></p>
  1970 -
  1971 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1972 -color:blue'>if ( (DISPLAY_PRICE_WITH_TAX == 'true') &amp;&amp;
  1973 -(tep_not_null($pfrom) || tep_not_null($pto)) ) {</span></p>
  1974 -
  1975 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1976 -color:blue'>� if (!tep_session_is_registered('customer_country_id')) {</span></p>
  1977 -
  1978 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1979 -color:blue'>��� $customer_country_id = STORE_COUNTRY;</span></p>
  1980 -
  1981 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1982 -color:blue'>��� $customer_zone_id = STORE_ZONE;</span></p>
  1983 -
  1984 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1985 -color:blue'>� }</span></p>
  1986 -
  1987 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1988 -color:blue'>� $from_str .= &quot; left join &quot; . TABLE_TAX_RATES . &quot;
  1989 -tr on p.products_tax_class_id = tr.tax_class_id left join &quot; .
  1990 -TABLE_ZONES_TO_GEO_ZONES . &quot; gz on tr.tax_zone_id = gz.geo_zone_id and
  1991 -(gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id =
  1992 -'&quot; . (int)$customer_country_id . &quot;') and (gz.zone_id is null or
  1993 -gz.zone_id = '0' or gz.zone_id = '&quot; . (int)$customer_zone_id .
  1994 -&quot;')&quot;;</span></p>
  1995 -
  1996 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  1997 -color:blue'>}</span></p>
  1998 -
  1999 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2000 -color:blue'>&nbsp;</span></p>
  2001 -
  2002 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2003 -color:blue'>$where_str = &quot; where p.products_status = '1' and p.products_id
  2004 -= pd.products_id and pd.language_id = '&quot; . (int)$languages_id . &quot;'
  2005 -and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id
  2006 -&quot;;</span></p>
  2007 -
  2008 -<p class=MsoNormal>&nbsp;</p>
  2009 -
  2010 -<span style='font-size:12.0pt;font-family:"Times New Roman"'><br clear=all
  2011 -style='page-break-before:always'>
  2012 -</span>
  2013 -
  2014 -<p class=MsoNormal>to:</p>
  2015 -
  2016 -<p class=MsoNormal>&nbsp;</p>
  2017 -
  2018 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2019 -color:blue'>$from_str = &quot;from &quot; . TABLE_PRODUCTS . &quot; p left join
  2020 -&quot; . TABLE_MANUFACTURERS . &quot; m using(manufacturers_id) left join
  2021 -&quot; . TABLE_SPECIALS . &quot; s on p.products_id = s.products_id&quot;;</span></p>
  2022 -
  2023 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2024 -color:blue'>&nbsp;</span></p>
  2025 -
  2026 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2027 -color:blue'>if ( (DISPLAY_PRICE_WITH_TAX == 'true') &amp;&amp;
  2028 -(tep_not_null($pfrom) || tep_not_null($pto)) ) {</span></p>
  2029 -
  2030 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2031 -color:blue'>� if (!tep_session_is_registered('customer_country_id')) {</span></p>
  2032 -
  2033 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2034 -color:blue'>��� $customer_country_id = STORE_COUNTRY;</span></p>
  2035 -
  2036 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2037 -color:blue'>��� $customer_zone_id = STORE_ZONE;</span></p>
  2038 -
  2039 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2040 -color:blue'>� }</span></p>
  2041 -
  2042 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2043 -color:blue'>� $from_str .= &quot; left join &quot; . TABLE_TAX_RATES . &quot;
  2044 -tr on p.products_tax_class_id = tr.tax_class_id left join &quot; .
  2045 -TABLE_ZONES_TO_GEO_ZONES . &quot; gz on tr.tax_zone_id = gz.geo_zone_id and
  2046 -(gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id =
  2047 -'&quot; . (int)$customer_country_id . &quot;') and (gz.zone_id is null or
  2048 -gz.zone_id = '0' or gz.zone_id = '&quot; . (int)$customer_zone_id .
  2049 -&quot;')&quot;;</span></p>
  2050 -
  2051 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2052 -color:blue'>}</span></p>
  2053 -
  2054 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2055 -color:blue'>&nbsp;</span></p>
  2056 -
  2057 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2058 -color:blue'>$from_str .= &quot;, &quot; . TABLE_PRODUCTS_DESCRIPTION . &quot;
  2059 -pd, &quot; . TABLE_CATEGORIES . &quot; c, &quot; . TABLE_PRODUCTS_TO_CATEGORIES
  2060 -. &quot; p2c&quot;;</span></p>
  2061 -
  2062 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2063 -color:blue'>&nbsp;</span></p>
  2064 -
  2065 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2066 -color:blue'>$where_str = &quot; where p.products_status = '1' and p.products_id
  2067 -= pd.products_id and pd.language_id = '&quot; . (int)$languages_id . &quot;'
  2068 -and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id
  2069 -&quot;;</span></p>
  2070 -
  2071 -<p class=MsoNormal>&nbsp;</p>
  2072 -
  2073 -<p class=MsoNormal>The following lines must be replaced in catalog/index.php:</p>
  2074 -
  2075 -<p class=MsoNormal>&nbsp;</p>
  2076 -
  2077 -<p class=MsoNormal>Line 175, from:</p>
  2078 -
  2079 -<p class=MsoNormal>&nbsp;</p>
  2080 -
  2081 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2082 -color:blue'>$listing_sql = &quot;select &quot; . $select_column_list . &quot;
  2083 -p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id,
  2084 -IF(s.status, s.specials_new_products_price, NULL) as
  2085 -specials_new_products_price, IF(s.status, s.specials_new_products_price,
  2086 -p.products_price) as final_price from &quot; . TABLE_PRODUCTS . &quot; p,
  2087 -&quot; . TABLE_PRODUCTS_DESCRIPTION . &quot; pd, &quot; . TABLE_MANUFACTURERS .
  2088 -&quot; m, &quot; . TABLE_PRODUCTS_TO_CATEGORIES . &quot; p2c <span
  2089 -style='background:yellow'>left join &quot; . TABLE_SPECIALS . &quot; s on
  2090 -p.products_id = s.products_id</span> where p.products_status = '1' and
  2091 -p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '&quot; .
  2092 -(int)$HTTP_GET_VARS['manufacturers_id'] . &quot;' and p.products_id =
  2093 -p2c.products_id and pd.products_id = p2c.products_id and pd.language_id =
  2094 -'&quot; . (int)$languages_id . &quot;' and p2c.categories_id = '&quot; .
  2095 -(int)$HTTP_GET_VARS['filter_id'] . &quot;'&quot;;</span></p>
  2096 -
  2097 -<p class=MsoNormal>&nbsp;</p>
  2098 -
  2099 -<p class=MsoNormal>to:</p>
  2100 -
  2101 -<p class=MsoNormal>&nbsp;</p>
  2102 -
  2103 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2104 -color:blue'>$listing_sql = &quot;select &quot; . $select_column_list . &quot;
  2105 -p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id,
  2106 -IF(s.status, s.specials_new_products_price, NULL) as
  2107 -specials_new_products_price, IF(s.status, s.specials_new_products_price,
  2108 -p.products_price) as final_price from &quot; . TABLE_PRODUCTS . &quot; p <span
  2109 -style='background:yellow'>left join &quot; . TABLE_SPECIALS . &quot; s on
  2110 -p.products_id = s.products_id</span>, &quot; . TABLE_PRODUCTS_DESCRIPTION .
  2111 -&quot; pd, &quot; . TABLE_MANUFACTURERS . &quot; m, &quot; .
  2112 -TABLE_PRODUCTS_TO_CATEGORIES . &quot; p2c where p.products_status = '1' and
  2113 -p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '&quot; .
  2114 -(int)$HTTP_GET_VARS['manufacturers_id'] . &quot;' and p.products_id =
  2115 -p2c.products_id and pd.products_id = p2c.products_id and pd.language_id =
  2116 -'&quot; . (int)$languages_id . &quot;' and p2c.categories_id = '&quot; .
  2117 -(int)$HTTP_GET_VARS['filter_id'] . &quot;'&quot;;</span></p>
  2118 -
  2119 -<p class=MsoNormal>&nbsp;</p>
  2120 -
  2121 -<span style='font-size:12.0pt;font-family:"Times New Roman"'><br clear=all
  2122 -style='page-break-before:always'>
  2123 -</span>
  2124 -
  2125 -<p class=MsoNormal>Line 178, from:</p>
  2126 -
  2127 -<p class=MsoNormal>&nbsp;</p>
  2128 -
  2129 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2130 -color:blue'>$listing_sql = &quot;select &quot; . $select_column_list . &quot;
  2131 -p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id,
  2132 -IF(s.status, s.specials_new_products_price, NULL) as
  2133 -specials_new_products_price, IF(s.status, s.specials_new_products_price,
  2134 -p.products_price) as final_price from &quot; . TABLE_PRODUCTS . &quot; p,
  2135 -&quot; . TABLE_PRODUCTS_DESCRIPTION . &quot; pd, &quot; . TABLE_MANUFACTURERS .
  2136 -&quot; m <span style='background:yellow'>left join &quot; . TABLE_SPECIALS .
  2137 -&quot; s on p.products_id = s.products_id</span> where p.products_status = '1'
  2138 -and pd.products_id = p.products_id and pd.language_id = '&quot; .
  2139 -(int)$languages_id . &quot;' and p.manufacturers_id = m.manufacturers_id and
  2140 -m.manufacturers_id = '&quot; . (int)$HTTP_GET_VARS['manufacturers_id'] .
  2141 -&quot;'&quot;;</span></p>
  2142 -
  2143 -<p class=MsoNormal>&nbsp;</p>
  2144 -
  2145 -<p class=MsoNormal>to:</p>
  2146 -
  2147 -<p class=MsoNormal>&nbsp;</p>
  2148 -
  2149 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2150 -color:blue'>$listing_sql = &quot;select &quot; . $select_column_list . &quot;
  2151 -p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id,
  2152 -IF(s.status, s.specials_new_products_price, NULL) as
  2153 -specials_new_products_price, IF(s.status, s.specials_new_products_price,
  2154 -p.products_price) as final_price from &quot; . TABLE_PRODUCTS . &quot; p <span
  2155 -style='background:yellow'>left join &quot; . TABLE_SPECIALS . &quot; s on
  2156 -p.products_id = s.products_id</span>, &quot; . TABLE_PRODUCTS_DESCRIPTION .
  2157 -&quot; pd, &quot; . TABLE_MANUFACTURERS . &quot; m where p.products_status =
  2158 -'1' and pd.products_id = p.products_id and pd.language_id = '&quot; . (int)$languages_id
  2159 -. &quot;' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id =
  2160 -'&quot; . (int)$HTTP_GET_VARS['manufacturers_id'] . &quot;'&quot;;</span></p>
  2161 -
  2162 -<p class=MsoNormal>&nbsp;</p>
  2163 -
  2164 -<p class=MsoNormal>Line 184, from:</p>
  2165 -
  2166 -<p class=MsoNormal>&nbsp;</p>
  2167 -
  2168 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2169 -color:blue'>$listing_sql = &quot;select &quot; . $select_column_list . &quot;
  2170 -p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id,
  2171 -IF(s.status, s.specials_new_products_price, NULL) as
  2172 -specials_new_products_price, IF(s.status, s.specials_new_products_price,
  2173 -p.products_price) as final_price from &quot; . TABLE_PRODUCTS . &quot; p,
  2174 -&quot; . TABLE_PRODUCTS_DESCRIPTION . &quot; pd, &quot; . TABLE_MANUFACTURERS .
  2175 -&quot; m, &quot; . TABLE_PRODUCTS_TO_CATEGORIES . &quot; p2c <span
  2176 -style='background:yellow'>left join &quot; . TABLE_SPECIALS . &quot; s on
  2177 -p.products_id = s.products_id</span> where p.products_status = '1' and
  2178 -p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '&quot; . (int)$HTTP_GET_VARS['filter_id']
  2179 -. &quot;' and p.products_id = p2c.products_id and pd.products_id =
  2180 -p2c.products_id and pd.language_id = '&quot; . (int)$languages_id . &quot;' and
  2181 -p2c.categories_id = '&quot; . (int)$current_category_id . &quot;'&quot;;</span></p>
  2182 -
  2183 -<p class=MsoNormal>&nbsp;</p>
  2184 -
  2185 -<p class=MsoNormal>to:</p>
  2186 -
  2187 -<p class=MsoNormal>&nbsp;</p>
  2188 -
  2189 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2190 -color:blue'>$listing_sql = &quot;select &quot; . $select_column_list . &quot;
  2191 -p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id,
  2192 -IF(s.status, s.specials_new_products_price, NULL) as
  2193 -specials_new_products_price, IF(s.status, s.specials_new_products_price,
  2194 -p.products_price) as final_price from &quot; . TABLE_PRODUCTS . &quot; p <span
  2195 -style='background:yellow'>left join &quot; . TABLE_SPECIALS . &quot; s on
  2196 -p.products_id = s.products_id</span>, &quot; . TABLE_PRODUCTS_DESCRIPTION .
  2197 -&quot; pd, &quot; . TABLE_MANUFACTURERS . &quot; m, &quot; .
  2198 -TABLE_PRODUCTS_TO_CATEGORIES . &quot; p2c where p.products_status = '1' and
  2199 -p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '&quot; .
  2200 -(int)$HTTP_GET_VARS['filter_id'] . &quot;' and p.products_id = p2c.products_id
  2201 -and pd.products_id = p2c.products_id and pd.language_id = '&quot; .
  2202 -(int)$languages_id . &quot;' and p2c.categories_id = '&quot; . (int)$current_category_id
  2203 -. &quot;'&quot;;</span></p>
  2204 -
  2205 -<p class=MsoNormal>&nbsp;</p>
  2206 -
  2207 -<span style='font-size:12.0pt;font-family:"Times New Roman"'><br clear=all
  2208 -style='page-break-before:always'>
  2209 -</span>
  2210 -
  2211 -<p class=MsoNormal>Line 187, from:</p>
  2212 -
  2213 -<p class=MsoNormal>&nbsp;</p>
  2214 -
  2215 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2216 -color:blue'>$listing_sql = &quot;select &quot; . $select_column_list . &quot;
  2217 -p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id,
  2218 -IF(s.status, s.specials_new_products_price, NULL) as
  2219 -specials_new_products_price, IF(s.status, s.specials_new_products_price,
  2220 -p.products_price) as final_price from &quot; . TABLE_PRODUCTS_DESCRIPTION .
  2221 -&quot; pd, &quot; . TABLE_PRODUCTS . &quot; p left join &quot; .
  2222 -TABLE_MANUFACTURERS . &quot; m on p.manufacturers_id = m.manufacturers_id,
  2223 -&quot; . TABLE_PRODUCTS_TO_CATEGORIES . &quot; p2c <span style='background:
  2224 -yellow'>left join &quot; . TABLE_SPECIALS . &quot; s on p.products_id =
  2225 -s.products_id</span> where p.products_status = '1' and p.products_id =
  2226 -p2c.products_id and pd.products_id = p2c.products_id and pd.language_id =
  2227 -'&quot; . (int)$languages_id . &quot;' and p2c.categories_id = '&quot; .
  2228 -(int)$current_category_id . &quot;'&quot;;</span></p>
  2229 -
  2230 -<p class=MsoNormal>&nbsp;</p>
  2231 -
  2232 -<p class=MsoNormal>to:</p>
  2233 -
  2234 -<p class=MsoNormal>&nbsp;</p>
  2235 -
  2236 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2237 -color:blue'>$listing_sql = &quot;select &quot; . $select_column_list . &quot;
  2238 -p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id,
  2239 -IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price,
  2240 -IF(s.status, s.specials_new_products_price, p.products_price) as final_price
  2241 -from &quot; . TABLE_PRODUCTS_DESCRIPTION . &quot; pd, &quot; . TABLE_PRODUCTS .
  2242 -&quot; p left join &quot; . TABLE_MANUFACTURERS . &quot; m on
  2243 -p.manufacturers_id = m.manufacturers_id <span style='background:yellow'>left
  2244 -join &quot; . TABLE_SPECIALS . &quot; s on p.products_id = s.products_id</span>,
  2245 -&quot; . TABLE_PRODUCTS_TO_CATEGORIES . &quot; p2c where p.products_status =
  2246 -'1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id
  2247 -and pd.language_id = '&quot; . (int)$languages_id . &quot;' and p2c.categories_id
  2248 -= '&quot; . (int)$current_category_id . &quot;'&quot;;</span></p>
  2249 -
  2250 -<p class=MsoNormal>&nbsp;</p>
  2251 -
  2252 -<p class=MsoNormal>Line 292 in catalog/admin/categories.php must be changed
  2253 -from:</p>
  2254 -
  2255 -<p class=MsoNormal>&nbsp;</p>
  2256 -
  2257 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2258 -color:blue'>tep_db_query(&quot;insert into &quot; . TABLE_PRODUCTS . &quot;
  2259 -(products_quantity, products_model,products_image, products_price,
  2260 -products_date_added, products_date_available, products_weight, products_status,
  2261 -products_tax_class_id, manufacturers_id) values ('&quot; .
  2262 -tep_db_input($product['products_quantity']) . &quot;', '&quot; .
  2263 -tep_db_input($product['products_model']) . &quot;', '&quot; .
  2264 -tep_db_input($product['products_image']) . &quot;', '&quot; .
  2265 -tep_db_input($product['products_price']) . &quot;',� now(), <span
  2266 -style='background:yellow'>'&quot; .
  2267 -tep_db_input($product['products_date_available']) . &quot;'</span>, '&quot; .
  2268 -tep_db_input($product['products_weight']) . &quot;', '0', '&quot; .
  2269 -(int)$product['products_tax_class_id'] . &quot;', '&quot; .
  2270 -(int)$product['manufacturers_id'] . &quot;')&quot;);</span></p>
  2271 -
  2272 -<p class=MsoNormal>&nbsp;</p>
  2273 -
  2274 -<p class=MsoNormal>to:</p>
  2275 -
  2276 -<p class=MsoNormal>&nbsp;</p>
  2277 -
  2278 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2279 -color:blue'>tep_db_query(&quot;insert into &quot; . TABLE_PRODUCTS . &quot;
  2280 -(products_quantity, products_model,products_image, products_price,
  2281 -products_date_added, products_date_available, products_weight, products_status,
  2282 -products_tax_class_id, manufacturers_id) values ('&quot; .
  2283 -tep_db_input($product['products_quantity']) . &quot;', '&quot; .
  2284 -tep_db_input($product['products_model']) . &quot;', '&quot; .
  2285 -tep_db_input($product['products_image']) . &quot;', '&quot; .
  2286 -tep_db_input($product['products_price']) . &quot;',� now(), <span
  2287 -style='background:yellow'>&quot; . (empty($product['products_date_available'])
  2288 -? &quot;null&quot; : &quot;'&quot; .
  2289 -tep_db_input($product['products_date_available']) . &quot;'&quot;) . &quot;</span>,
  2290 -'&quot; . tep_db_input($product['products_weight']) . &quot;', '0', '&quot; .
  2291 -(int)$product['products_tax_class_id'] . &quot;', '&quot; .
  2292 -(int)$product['manufacturers_id'] . &quot;')&quot;);</span></p>
  2293 -
  2294 -<p class=MsoNormal>&nbsp;</p>
  2295 -
  2296 -<p class=MsoNormal>The following SQL queries need to be performed:</p>
  2297 -
  2298 -<p class=MsoNormal>&nbsp;</p>
  2299 -
  2300 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2301 -color:blue'>ALTER TABLE whos_online MODIFY COLUMN last_page_url VARCHAR(255)
  2302 -NOT NULL;</span></p>
  2303 -
  2304 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2305 -color:blue'>&nbsp;</span></p>
  2306 -
  2307 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2308 -color:blue'>ALTER TABLE customers MODIFY COLUMN customers_default_address_id
  2309 -INTEGER;</span></p>
  2310 -
  2311 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2312 -color:blue'>&nbsp;</span></p>
  2313 -
  2314 -<p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New";
  2315 -color:blue'>ALTER TABLE customers_basket MODIFY COLUMN final_price
  2316 -DECIMAL(15,4);</span></p>
  2317 -
  2318 -</div>
  2319 -
  2320 -</body>
  2321 -
  2322 -</html>