Download | Plain Text | No Line Numbers


  1. diff -Naur xtcommerce.orig/account_history_info.php xtcommerce/account_history_info.php
  2. --- xtcommerce.orig/account_history_info.php 2006-08-06 15:46:53.000000000 +0200
  3. +++ xtcommerce/account_history_info.php 2010-08-11 14:26:13.000000000 +0200
  4. @@ -86,7 +86,7 @@
  5. $smarty->assign('BILLING_ADDRESS_EDIT', xtc_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'));
  6. $smarty->assign('BUTTON_PRINT', '<a style="cursor:pointer" onclick="javascript:window.open(\''.xtc_href_link(FILENAME_PRINT_ORDER, 'oID='.(int)$_GET['order_id']).'\', \'popup\', \'toolbar=0, width=640, height=600\')"><img src="'.'templates/'.CURRENT_TEMPLATE.'/buttons/'.$_SESSION['language'].'/button_print.gif"/></a>');
  7.  
  8. -$from_history = eregi("page=", xtc_get_all_get_params()); // referer from account_history yes/no
  9. +$from_history = preg_match("/page=/i", xtc_get_all_get_params()); // referer from account_history yes/no
  10. $back_to = $from_history ? FILENAME_ACCOUNT_HISTORY : FILENAME_ACCOUNT; // if from account_history => return to account_history
  11. $smarty->assign('BUTTON_BACK','<a href="' . xtc_href_link($back_to,xtc_get_all_get_params(array ('order_id')), 'SSL') . '">' . xtc_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>');
  12.  
  13. @@ -99,4 +99,4 @@
  14. if (!defined(RM)) { $smarty->load_filter('output', 'note'); }
  15. $smarty->display(CURRENT_TEMPLATE.'/index.html');
  16. include ('includes/application_bottom.php');
  17. -?>
  18. \ No newline at end of file
  19. +?>
  20. diff -Naur xtcommerce.orig/admin/backup.php xtcommerce/admin/backup.php
  21. --- xtcommerce.orig/admin/backup.php 2005-07-14 13:41:38.000000000 +0200
  22. +++ xtcommerce/admin/backup.php 2010-08-10 17:56:23.000000000 +0200
  23. @@ -51,7 +51,7 @@
  24. if (isset($fields['Extra'])) $schema .= ' ' . $fields['Extra'];
  25. $schema .= ',' . "\n";
  26. }
  27. - $schema = ereg_replace(",\n$", '', $schema);
  28. + $schema = preg_replace("/,\n$/", '', $schema);
  29.  
  30. // Add the keys
  31. $index = array();
  32. @@ -87,13 +87,13 @@
  33. $schema_insert .= 'NULL, ';
  34. } elseif ($rows[$i] != '') {
  35. $row = addslashes($rows[$i]);
  36. - $row = ereg_replace("\n#", "\n".'\#', $row);
  37. + $row = preg_replace("/\n#/", "\n".'\#', $row);
  38. $schema_insert .= '\'' . $row . '\', ';
  39. } else {
  40. $schema_insert .= '\'\', ';
  41. }
  42. }
  43. - $schema_insert = ereg_replace(', $', '', $schema_insert) . ');' . "\n";
  44. + $schema_insert = preg_replace('/, $/', '', $schema_insert) . ');' . "\n";
  45. $schema .= $schema_insert;
  46. }
  47. $schema .= "\n";
  48. @@ -237,7 +237,7 @@
  49. if ($next == '') { // get the last insert query
  50. $next = 'insert';
  51. }
  52. - if ( (eregi('create', $next)) || (eregi('insert', $next)) || (eregi('drop t', $next)) ) {
  53. + if ( (preg_match('/create/i', $next)) || (preg_match('/insert/i', $next)) || (preg_match('/drop t/i', $next)) ) {
  54. $next = '';
  55. $sql_array[] = substr($restore_query, 0, $i);
  56. $restore_query = ltrim(substr($restore_query, $i+1));
  57. @@ -487,4 +487,4 @@
  58. <br />
  59. </body>
  60. </html>
  61. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  62. \ No newline at end of file
  63. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  64. diff -Naur xtcommerce.orig/admin/configuration.php xtcommerce/admin/configuration.php
  65. --- xtcommerce.orig/admin/configuration.php 2005-07-28 11:59:44.000000000 +0200
  66. +++ xtcommerce/admin/configuration.php 2010-08-10 17:57:43.000000000 +0200
  67. @@ -139,7 +139,7 @@
  68. }
  69. if (xtc_not_null($configuration['use_function'])) {
  70. $use_function = $configuration['use_function'];
  71. - if (ereg('->', $use_function)) {
  72. + if (preg_match('/->/', $use_function)) {
  73. $class_method = explode('->', $use_function);
  74. if (!is_object(${$class_method[0]})) {
  75. include(DIR_WS_CLASSES . $class_method[0] . '.php');
  76. @@ -203,4 +203,4 @@
  77. <br />
  78. </body>
  79. </html>
  80. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  81. \ No newline at end of file
  82. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  83. diff -Naur xtcommerce.orig/admin/content_manager.php xtcommerce/admin/content_manager.php
  84. --- xtcommerce.orig/admin/content_manager.php 2006-03-15 15:06:02.000000000 +0100
  85. +++ xtcommerce/admin/content_manager.php 2010-08-11 13:56:11.000000000 +0200
  86. @@ -1024,19 +1024,19 @@
  87. <?php
  88. // display preview button if filetype
  89. // .gif,.jpg,.png,.html,.htm,.txt,.tif,.bmp
  90. -if ( eregi('.gif',$content_array[$ii]['file'])
  91. +if ( preg_match('/.gif/i',$content_array[$ii]['file'])
  92. or
  93. - eregi('.jpg',$content_array[$ii]['file'])
  94. + preg_match('/.jpg/i',$content_array[$ii]['file'])
  95. or
  96. - eregi('.png',$content_array[$ii]['file'])
  97. + preg_match('/.png/i',$content_array[$ii]['file'])
  98. or
  99. - eregi('.html',$content_array[$ii]['file'])
  100. + preg_match('/.html/i',$content_array[$ii]['file'])
  101. or
  102. - eregi('.htm',$content_array[$ii]['file'])
  103. + preg_match('/.htm/i',$content_array[$ii]['file'])
  104. or
  105. - eregi('.txt',$content_array[$ii]['file'])
  106. + preg_match('/.txt/i',$content_array[$ii]['file'])
  107. or
  108. - eregi('.bmp',$content_array[$ii]['file'])
  109. + preg_match('/.bmp/i',$content_array[$ii]['file'])
  110. ) {
  111. ?>
  112. <a style="cursor:pointer" onClick="javascript:window.open('<?php echo xtc_href_link(FILENAME_CONTENT_PREVIEW,'pID=media&coID='.$content_array[$ii]['id']); ?>', 'popup', 'toolbar=0, width=640, height=600')"
  113. @@ -1082,4 +1082,4 @@
  114. </body>
  115. </html>
  116.  
  117. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  118. \ No newline at end of file
  119. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  120. diff -Naur xtcommerce.orig/admin/content_preview.php xtcommerce/admin/content_preview.php
  121. --- xtcommerce.orig/admin/content_preview.php 2005-10-12 20:04:44.000000000 +0200
  122. +++ xtcommerce/admin/content_preview.php 2010-08-11 15:40:00.000000000 +0200
  123. @@ -51,7 +51,7 @@
  124. if (strpos($content_data['content_file'],'.txt')) echo '<pre>';
  125. if ($_GET['pID']=='media') {
  126. // display image
  127. - if (eregi('.gif',$content_data['content_file']) or eregi('.jpg',$content_data['content_file']) or eregi('.png',$content_data['content_file']) or eregi('.tif',$content_data['content_file']) or eregi('.bmp',$content_data['content_file'])) {
  128. + if (preg_match('/\.gif/i',$content_data['content_file']) or preg_match('/\.jpg/i',$content_data['content_file']) or preg_match('/\.png/i',$content_data['content_file']) or preg_match('/\.tif/i',$content_data['content_file']) or preg_match('/\.bmp/i',$content_data['content_file'])) {
  129. echo xtc_image(DIR_WS_CATALOG.'media/products/'.$content_data['content_file']);
  130. } else {
  131. include(DIR_FS_CATALOG.'media/products/'.$content_data['content_file']);
  132. @@ -68,4 +68,4 @@
  133. </tr>
  134. </table>
  135. </body>
  136. -</html>
  137. \ No newline at end of file
  138. +</html>
  139. diff -Naur xtcommerce.orig/admin/coupon_admin.php xtcommerce/admin/coupon_admin.php
  140. --- xtcommerce.orig/admin/coupon_admin.php 2005-07-23 20:36:08.000000000 +0200
  141. +++ xtcommerce/admin/coupon_admin.php 2010-08-11 13:54:03.000000000 +0200
  142. @@ -728,15 +728,15 @@
  143. <tr>
  144. <?php
  145. if (!$_POST['coupon_startdate']) {
  146. - $coupon_startdate = split("[-]", date('Y-m-d'));
  147. + $coupon_startdate = explode("-", date('Y-m-d'));
  148. } else {
  149. - $coupon_startdate = split("[-]", $_POST['coupon_startdate']);
  150. + $coupon_startdate = explode("-", $_POST['coupon_startdate']);
  151. }
  152. if (!$_POST['coupon_finishdate']) {
  153. - $coupon_finishdate = split("[-]", date('Y-m-d'));
  154. + $coupon_finishdate = explode("-", date('Y-m-d'));
  155. $coupon_finishdate[0] = $coupon_finishdate[0] + 1;
  156. } else {
  157. - $coupon_finishdate = split("[-]", $_POST['coupon_finishdate']);
  158. + $coupon_finishdate = explode("-", $_POST['coupon_finishdate']);
  159. }
  160. ?>
  161. <td align="left" class="main"><?php echo COUPON_STARTDATE; ?></td>
  162. @@ -934,4 +934,4 @@
  163. <!-- footer_eof //-->
  164. </body>
  165. </html>
  166. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  167. \ No newline at end of file
  168. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  169. diff -Naur xtcommerce.orig/admin/csv_backend.php xtcommerce/admin/csv_backend.php
  170. --- xtcommerce.orig/admin/csv_backend.php 2005-07-14 22:22:32.000000000 +0200
  171. +++ xtcommerce/admin/csv_backend.php 2010-08-11 13:57:12.000000000 +0200
  172. @@ -143,7 +143,7 @@
  173. }
  174. if (xtc_not_null($configuration['use_function'])) {
  175. $use_function = $configuration['use_function'];
  176. - if (ereg('->', $use_function)) {
  177. + if (preg_match('/->/', $use_function)) {
  178. $class_method = explode('->', $use_function);
  179. if (!is_object(${$class_method[0]})) {
  180. include(DIR_WS_CLASSES . $class_method[0] . '.php');
  181. @@ -334,4 +334,4 @@
  182. <!-- footer_eof //-->
  183. </body>
  184. </html>
  185. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  186. \ No newline at end of file
  187. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  188. diff -Naur xtcommerce.orig/admin/econda.php xtcommerce/admin/econda.php
  189. --- xtcommerce.orig/admin/econda.php 2006-08-05 16:49:41.000000000 +0200
  190. +++ xtcommerce/admin/econda.php 2010-08-11 13:57:25.000000000 +0200
  191. @@ -89,7 +89,7 @@
  192. while ($configuration = xtc_db_fetch_array($configuration_query)) {
  193. if (xtc_not_null($configuration['use_function'])) {
  194. $use_function = $configuration['use_function'];
  195. - if (ereg('->', $use_function)) {
  196. + if (preg_match('/->/', $use_function)) {
  197. $class_method = explode('->', $use_function);
  198. if (!is_object(${$class_method[0]})) {
  199. include(DIR_WS_CLASSES . $class_method[0] . '.php');
  200. @@ -259,4 +259,4 @@
  201. <!-- footer_eof //-->
  202. </body>
  203. </html>
  204. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  205. \ No newline at end of file
  206. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  207. diff -Naur xtcommerce.orig/admin/includes/application_top.php xtcommerce/admin/includes/application_top.php
  208. --- xtcommerce.orig/admin/includes/application_top.php 2006-08-20 23:56:19.000000000 +0200
  209. +++ xtcommerce/admin/includes/application_top.php 2010-08-11 13:52:41.000000000 +0200
  210. @@ -396,7 +396,7 @@
  211. // include the language translations
  212. require(DIR_FS_LANGUAGES . $_SESSION['language'] . '/admin/'.$_SESSION['language'] . '.php');
  213. require(DIR_FS_LANGUAGES . $_SESSION['language'] . '/admin/buttons.php');
  214. - $current_page = split('\?', basename($_SERVER['PHP_SELF'])); $current_page = $current_page[0]; // for BadBlue(Win32) webserver compatibility
  215. + $current_page = explode('?', basename($_SERVER['PHP_SELF'])); $current_page = $current_page[0]; // for BadBlue(Win32) webserver compatibility
  216. if (file_exists(DIR_FS_LANGUAGES . $_SESSION['language'] . '/admin/'.$current_page)) {
  217. include(DIR_FS_LANGUAGES . $_SESSION['language'] . '/admin/'. $current_page);
  218. }
  219. @@ -497,4 +497,4 @@
  220. require(DIR_FS_CATALOG.DIR_WS_CLASSES . 'Smarty_2.6.14/Smarty.class.php');
  221.  
  222.  
  223. -?>
  224. \ No newline at end of file
  225. +?>
  226. diff -Naur xtcommerce.orig/admin/includes/classes/language.php xtcommerce/admin/includes/classes/language.php
  227. --- xtcommerce.orig/admin/includes/classes/language.php 2005-05-14 18:45:22.000000000 +0200
  228. +++ xtcommerce/admin/includes/classes/language.php 2010-08-10 18:07:58.000000000 +0200
  229. @@ -91,7 +91,7 @@
  230. for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
  231. reset($this->languages);
  232. while (list($key, $value) = each($this->languages)) {
  233. - if (eregi('^(' . $value[0] . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
  234. + if (preg_match('/^(' . $value[0] . ')(;q=[0-9]\\.[0-9])?$/i', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
  235. $this->language = $this->catalog_languages[$key];
  236. break 2;
  237. }
  238. @@ -99,4 +99,4 @@
  239. }
  240. }
  241. }
  242. -?>
  243. \ No newline at end of file
  244. +?>
  245. diff -Naur xtcommerce.orig/admin/includes/classes/phplot.php xtcommerce/admin/includes/classes/phplot.php
  246. --- xtcommerce.orig/admin/includes/classes/phplot.php 2005-05-14 18:45:22.000000000 +0200
  247. +++ xtcommerce/admin/includes/classes/phplot.php 2010-08-10 18:09:58.000000000 +0200
  248. @@ -678,8 +678,8 @@
  249. if ($which_valign == 'top') {
  250. $which_ypos = $which_ypos - ImageFontHeight($which_font);
  251. }
  252. - $which_text = ereg_replace("\r","",$which_text);
  253. - $str = split("\n",$which_text); //multiple lines submitted by Remi Ricard
  254. + $which_text = preg_replace("/\r/","",$which_text);
  255. + $str = explode("\n",$which_text); //multiple lines submitted by Remi Ricard
  256. $height = ImageFontHeight($which_font);
  257. $width = ImageFontWidth($which_font);
  258. if ($which_angle == 90) { //Vertical Code Submitted by Marlin Viss
  259. @@ -783,7 +783,7 @@
  260. function SetPlotType($which_pt) {
  261. $accepted = "bars,lines,linepoints,area,points,pie,thinbarline";
  262. $asked = trim($which_pt);
  263. - if (eregi($asked, $accepted)) {
  264. + if (preg_match('/' . $asked .'/i', $accepted)) {
  265. $this->plot_type = $which_pt;
  266. return true;
  267. } else {
  268. @@ -940,7 +940,7 @@
  269. // It thus depends on the current character size, set by SetCharacterHeight().
  270. /////////////////////////////////////////////////////////////////
  271.  
  272. - $str = split("\n",$this->title_txt);
  273. + $str = explode("\n",$this->title_txt);
  274. $nbLines = count($str);
  275.  
  276. if ($this->use_ttf == 1) {
  277. @@ -2634,4 +2634,4 @@
  278. }
  279. } //function DrawGraph
  280. }
  281. -?>
  282. \ No newline at end of file
  283. +?>
  284. diff -Naur xtcommerce.orig/admin/includes/classes/sessions.php xtcommerce/admin/includes/classes/sessions.php
  285. --- xtcommerce.orig/admin/includes/classes/sessions.php 2005-05-14 18:45:22.000000000 +0200
  286. +++ xtcommerce/admin/includes/classes/sessions.php 2010-08-10 18:13:06.000000000 +0200
  287. @@ -387,7 +387,7 @@
  288. // '<session-name>=<session-id>' to allow URLs of the form
  289. // http://yoursite/<session-name>=<session-id>/script.php
  290. if (empty($session->id)) {
  291. - eregi($session->name . '=([^/]+)', $GLOBALS['REQUEST_URI'], $regs);
  292. + preg_match('/' . $session->name . '=([^/]+)/i', $GLOBALS['REQUEST_URI'], $regs);
  293. $regs[1] = trim($regs[1]);
  294. if (!empty($regs[1])) {
  295. $session->id = $regs[1];
  296. @@ -516,4 +516,4 @@
  297. }
  298.  
  299. register_shutdown_function('session_close');
  300. -?>
  301. \ No newline at end of file
  302. +?>
  303. diff -Naur xtcommerce.orig/admin/includes/functions/compatibility.php xtcommerce/admin/includes/functions/compatibility.php
  304. --- xtcommerce.orig/admin/includes/functions/compatibility.php 2005-05-14 18:45:22.000000000 +0200
  305. +++ xtcommerce/admin/includes/functions/compatibility.php 2010-08-10 18:21:48.000000000 +0200
  306. @@ -44,9 +44,14 @@
  307. do_magic_quotes_gpc($_COOKIE);
  308. }
  309.  
  310. + // set default timezone if none exists (PHP 5.3 throws an E_WARNING)
  311. + if ((strlen(ini_get('date.timezone')) < 1) && function_exists('date_default_timezone_set')) {
  312. + date_default_timezone_set(@date_default_timezone_get());
  313. + }
  314. +
  315. if (!function_exists('is_numeric')) {
  316. function is_numeric($param) {
  317. - return ereg("^[0-9]{1,50}.?[0-9]{0,50}$", $param);
  318. + return preg_match("/^[0-9]{1,50}.?[0-9]{0,50}$/", $param);
  319. }
  320. }
  321.  
  322. @@ -77,7 +82,7 @@
  323. if(xtc_not_null($host) && xtc_not_null($type)) {
  324. @exec("nslookup -type=$type $host", $output);
  325. while(list($k, $line) = each($output)) {
  326. - if(eregi("^$host", $line)) {
  327. + if(preg_match("/^$host/i", $line)) {
  328. return true;
  329. }
  330. }
  331. @@ -85,4 +90,4 @@
  332. return false;
  333. }
  334. }
  335. -?>
  336. \ No newline at end of file
  337. +?>
  338. diff -Naur xtcommerce.orig/admin/includes/functions/general.php xtcommerce/admin/includes/functions/general.php
  339. --- xtcommerce.orig/admin/includes/functions/general.php 2006-04-15 15:39:30.000000000 +0200
  340. +++ xtcommerce/admin/includes/functions/general.php 2010-08-11 14:03:32.000000000 +0200
  341. @@ -226,7 +226,7 @@
  342. if (@ date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
  343. return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
  344. } else {
  345. - return ereg_replace('2037'.'$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
  346. + return preg_replace('/2037$/', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
  347. }
  348.  
  349. }
  350. @@ -1079,9 +1079,9 @@
  351. while ($cache_file = readdir($dir)) {
  352. $cached_file = $cache_blocks[$i]['file'];
  353. $languages = xtc_get_languages();
  354. - for ($j = 0, $k = sizeof($languages); $j < $k; $j ++) {
  355. - $cached_file_unlink = ereg_replace('-language', '-'.$languages[$j]['directory'], $cached_file);
  356. - if (ereg('^'.$cached_file_unlink, $cache_file)) {
  357. + for ($j = 0, $k = sizeof($languages); $j < $k; $j ++) {
  358. + $cached_file_unlink = preg_replace('/-language/', '-' . $languages[$j]['directory'], $cached_file);
  359. + if (preg_match('/^' . $cached_file_unlink . '/', $cache_file)) {
  360. @ unlink(DIR_FS_CACHE.$cache_file);
  361. }
  362. }
  363. @@ -1092,7 +1092,7 @@
  364. $cached_file = $cache_blocks[$i]['file'];
  365. $languages = xtc_get_languages();
  366. for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {
  367. - $cached_file = ereg_replace('-language', '-'.$languages[$i]['directory'], $cached_file);
  368. + $cached_file = preg_replace('/-language/', '-' . $languages[$i]['directory'], $cached_file);
  369. @ unlink(DIR_FS_CACHE.$cached_file);
  370. }
  371. }
  372. @@ -1398,7 +1398,7 @@
  373. // nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n)
  374. function xtc_convert_linefeeds($from, $to, $string) {
  375. if ((PHP_VERSION < "4.0.5") && is_array($from)) {
  376. - return ereg_replace('('.implode('|', $from).')', $to, $string);
  377. + return preg_replace('/(' . implode('|', $from) . ')/', $to, $string);
  378. } else {
  379. return str_replace($from, $to, $string);
  380. }
  381. @@ -1525,8 +1525,8 @@
  382.  
  383. function xtc_CheckExt($filename, $ext) {
  384. $passed = FALSE;
  385. - $testExt = "\.".$ext."$";
  386. - if (eregi($testExt, $filename)) {
  387. + $testExt = "/\.".$ext."$/i";
  388. + if (preg_match($testExt, $filename)) {
  389. $passed = TRUE;
  390. }
  391. return $passed;
  392. @@ -1679,4 +1679,4 @@
  393.  
  394.  
  395. //--------------------------------------------------------------------------------------Ende
  396. -?>
  397. \ No newline at end of file
  398. +?>
  399. diff -Naur xtcommerce.orig/admin/includes/functions/html_graphs.php xtcommerce/admin/includes/functions/html_graphs.php
  400. --- xtcommerce.orig/admin/includes/functions/html_graphs.php 2005-05-14 18:45:22.000000000 +0200
  401. +++ xtcommerce/admin/includes/functions/html_graphs.php 2010-08-10 18:22:36.000000000 +0200
  402. @@ -165,7 +165,7 @@
  403. $horizontal_graph_string .= '>';
  404.  
  405. // decide if the value in bar is a color code or image.
  406. - if (ereg('^#', $bars[$i])) {
  407. + if (preg_match('/^#/', $bars[$i])) {
  408. $horizontal_graph_string .= '<table cellpadding="0" cellspacing="0" bgcolor="' . $bars[$i] . '" width="' . ($values[$i] * $vals['scale']) . '">' . "\n" .
  409. ' <tr>' . "\n" .
  410. ' <td>&nbsp;</td>' . "\n" .
  411. @@ -256,7 +256,7 @@
  412. ' <td';
  413.  
  414. // set background to a color if it starts with # or an image otherwise.
  415. - if (ereg('^#', $dbars[$i])) {
  416. + if (preg_match('/^#/', $dbars[$i])) {
  417. $double_horizontal_graph_string .= ' bgcolor="' . $dbars[$i] . '">';
  418. } else {
  419. $double_horizontal_graph_string .= ' background="' . $dbars[$i] . '">';
  420. @@ -265,7 +265,7 @@
  421. $double_horizontal_graph_string .= '<nowrap>';
  422.  
  423. // decide if the value in bar is a color code or image.
  424. - if (ereg('^#', $bars[$i])) {
  425. + if (preg_match('/^#/', $bars[$i])) {
  426. $double_horizontal_graph_string .= '<table align="left" cellpadding="0" cellspacing="0" bgcolor="' . $bars[$i] . '" width="' . ($values[$i] * $vals['scale']) . '">' . "\n" .
  427. ' <tr>' . "\n" .
  428. ' <td>&nbsp;</td>' . "\n" .
  429. @@ -566,4 +566,4 @@
  430.  
  431. return html_graph($names, $values, $bars, $graph_vals, $dvalues, $dbars);
  432. }
  433. -?>
  434. \ No newline at end of file
  435. +?>
  436. diff -Naur xtcommerce.orig/admin/includes/functions/validations.php xtcommerce/admin/includes/functions/validations.php
  437. --- xtcommerce.orig/admin/includes/functions/validations.php 2005-05-14 18:45:22.000000000 +0200
  438. +++ xtcommerce/admin/includes/functions/validations.php 2010-08-11 13:40:42.000000000 +0200
  439. @@ -49,22 +49,22 @@
  440. function xtc_validate_email($email) {
  441. $valid_address = true;
  442.  
  443. - $mail_pat = '^(.+)@(.+)$';
  444. + $mail_pat = '/^(.+)@(.+)$/i';
  445. $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
  446. $atom = "$valid_chars+";
  447. $quoted_user='(\"[^\"]*\")';
  448. $word = "($atom|$quoted_user)";
  449. - $user_pat = "^$word(\.$word)*$";
  450. - $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
  451. - $domain_pat = "^$atom(\.$atom)*$";
  452. + $user_pat = "/^$word(\.$word)*$/i";
  453. + $ip_domain_pat='/^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$/i';
  454. + $domain_pat = "/^$atom(\.$atom)*$/i";
  455.  
  456. - if (eregi($mail_pat, $email, $components)) {
  457. + if (preg_match($mail_pat, $email, $components)) {
  458. $user = $components[1];
  459. $domain = $components[2];
  460. // validate user
  461. - if (eregi($user_pat, $user)) {
  462. + if (preg_match($user_pat, $user)) {
  463. // validate domain
  464. - if (eregi($ip_domain_pat, $domain, $ip_components)) {
  465. + if (preg_match($ip_domain_pat, $domain, $ip_components)) {
  466. // this is an IP address
  467. for ($i=1;$i<=4;$i++) {
  468. if ($ip_components[$i] > 255) {
  469. @@ -74,7 +74,7 @@
  470. }
  471. } else {
  472. // Domain is a name, not an IP
  473. - if (eregi($domain_pat, $domain)) {
  474. + if (preg_match($domain_pat, $domain)) {
  475. /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD
  476. and that there's a hostname preceding the domain or country. */
  477. $domain_components = explode(".", $domain);
  478. @@ -84,7 +84,7 @@
  479. } else {
  480. $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);
  481. // Allow all 2-letter TLDs (ccTLDs)
  482. - if (eregi('^[a-z][a-z]$', $top_level_domain) != 1) {
  483. + if (preg_match('/^[a-z][a-z]$/i', $top_level_domain) != 1) {
  484. $tld_pattern = '';
  485. // Get authorized TLDs from text file
  486. $tlds = file(DIR_WS_INCLUDES . 'tld.txt');
  487. @@ -93,13 +93,13 @@
  488. $words = explode('#', $line);
  489. $tld = trim($words[0]);
  490. // TLDs should be 3 letters or more
  491. - if (eregi('^[a-z]{3,}$', $tld) == 1) {
  492. + if (preg_match('/^[a-z]{3,}$/i', $tld) == 1) {
  493. $tld_pattern .= '^' . $tld . '$|';
  494. }
  495. }
  496. // Remove last '|'
  497. $tld_pattern = substr($tld_pattern, 0, -1);
  498. - if (eregi("$tld_pattern", $top_level_domain) == 0) {
  499. + if (preg_match("/$tld_pattern/i", $top_level_domain) == 0) {
  500. $valid_address = false;
  501. }
  502. }
  503. @@ -121,4 +121,4 @@
  504. }
  505. return $valid_address;
  506. }
  507. -?>
  508. \ No newline at end of file
  509. +?>
  510. diff -Naur xtcommerce.orig/admin/includes/modules/carp/carp.php xtcommerce/admin/includes/modules/carp/carp.php
  511. --- xtcommerce.orig/admin/includes/modules/carp/carp.php 2006-07-26 23:36:18.000000000 +0200
  512. +++ xtcommerce/admin/includes/modules/carp/carp.php 2010-08-11 14:02:50.000000000 +0200
  513. @@ -179,8 +179,8 @@
  514. function CarpOutput($t) {
  515. global $carpconf,$carpoutput;
  516.  
  517. - if (is_array($t)) { for ($i=0,$j=count($t);$i<$j;$i++) $t[$i]=ereg_replace("&apos;","'",$t[$i]); }
  518. - else $t=ereg_replace("&apos;","'",$t);
  519. + if (is_array($t)) { for ($i=0,$j=count($t);$i<$j;$i++) $t[$i]=preg_replace("/&apos;/","'",$t[$i]); }
  520. + else $t=preg_replace("/&apos;/","'",$t);
  521. switch ($carpconf['outputformat']) {
  522. case 1:
  523. if (!is_array($t)) $t=explode("\n",$t);
  524. @@ -370,4 +370,4 @@
  525.  
  526. if (file_exists(CarpDirName()."/carpconf.php")) require_once CarpDirName()."/carpconf.php";
  527. else CarpConfReset();
  528. -?>
  529. \ No newline at end of file
  530. +?>
  531. diff -Naur xtcommerce.orig/admin/includes/modules/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php xtcommerce/admin/includes/modules/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
  532. --- xtcommerce.orig/admin/includes/modules/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php 2005-10-07 17:40:50.000000000 +0200
  533. +++ xtcommerce/admin/includes/modules/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php 2010-08-11 14:00:32.000000000 +0200
  534. @@ -31,7 +31,7 @@
  535. else
  536. $GLOBALS["UserFilesPath"] = '/UserFiles/' ;
  537.  
  538. -if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
  539. +if ( ! preg_match( '/\/$/', $GLOBALS["UserFilesPath"] ) )
  540. $GLOBALS["UserFilesPath"] .= '/' ;
  541.  
  542. // Map the "UserFiles" path to a local directory.
  543. @@ -55,7 +55,7 @@
  544. return ;
  545.  
  546. // Check the current folder syntax (must begin and start with a slash).
  547. - if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
  548. + if ( ! preg_match( '/\/$/', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
  549. if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ;
  550.  
  551. // Check for invalid folder paths (..)
  552. diff -Naur xtcommerce.orig/admin/listcategories.php xtcommerce/admin/listcategories.php
  553. --- xtcommerce.orig/admin/listcategories.php 2005-10-18 17:49:16.000000000 +0200
  554. +++ xtcommerce/admin/listcategories.php 2010-08-11 13:54:17.000000000 +0200
  555. @@ -54,7 +54,7 @@
  556. $coupon_get=xtc_db_query("select restrict_to_categories from " . TABLE_COUPONS . " where coupon_id='".$_GET['cid']."'");
  557. $get_result=xtc_db_fetch_array($coupon_get);
  558. echo "<tr><th>Category ID</th><th>Category Name</th></tr><tr>";
  559. - $cat_ids = split("[,]", $get_result['restrict_to_categories']);
  560. + $cat_ids = explode(",", $get_result['restrict_to_categories']);
  561. for ($i = 0; $i < count($cat_ids); $i++) {
  562. $result = xtc_db_query("SELECT * FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd WHERE c.categories_id = cd.categories_id and cd.language_id = '" . $_SESSION['languages_id'] . "' and c.categories_id='" . $cat_ids[$i] . "'");
  563. if ($row = xtc_db_fetch_array($result)) {
  564. @@ -71,4 +71,4 @@
  565. <td align=middle><input type="button" value="Close Window" onClick="window.close()"></td>
  566. </tr></table>
  567. </body>
  568. -</html>
  569. \ No newline at end of file
  570. +</html>
  571. diff -Naur xtcommerce.orig/admin/listproducts.php xtcommerce/admin/listproducts.php
  572. --- xtcommerce.orig/admin/listproducts.php 2005-10-18 16:18:20.000000000 +0200
  573. +++ xtcommerce/admin/listproducts.php 2010-08-11 13:54:12.000000000 +0200
  574. @@ -55,7 +55,7 @@
  575. $get_result=xtc_db_fetch_array($coupon_get);
  576.  
  577. echo "<tr><th>Product ID</th><th>Product Name</th><th>Product Size</th></tr><tr>";
  578. - $pr_ids = split("[,]", $get_result['restrict_to_products']);
  579. + $pr_ids = explode(",", $get_result['restrict_to_products']);
  580. for ($i = 0; $i < count($pr_ids); $i++) {
  581. $result = xtc_db_query("SELECT * FROM ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd WHERE p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "'and p.products_id = '" . $pr_ids[$i] . "'");
  582. if ($row = xtc_db_fetch_array($result)) {
  583. @@ -73,4 +73,4 @@
  584. <td align=middle><input type="button" value="Close Window" onClick="window.close()"></td>
  585. </tr></table>
  586. </body>
  587. -</html>
  588. \ No newline at end of file
  589. +</html>
  590. diff -Naur xtcommerce.orig/admin/module_export.php xtcommerce/admin/module_export.php
  591. --- xtcommerce.orig/admin/module_export.php 2005-08-25 14:37:14.000000000 +0200
  592. +++ xtcommerce/admin/module_export.php 2010-08-11 13:57:37.000000000 +0200
  593. @@ -240,7 +240,7 @@
  594. $keys .= '<b>' . $value['title'] . '</b><br />';
  595. if ($value['use_function']) {
  596. $use_function = $value['use_function'];
  597. - if (ereg('->', $use_function)) {
  598. + if (preg_match('/->/', $use_function)) {
  599. $class_method = explode('->', $use_function);
  600. if (!is_object(${$class_method[0]})) {
  601. include(DIR_WS_CLASSES . $class_method[0] . '.php');
  602. @@ -295,4 +295,4 @@
  603. <br />
  604. </body>
  605. </html>
  606. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  607. \ No newline at end of file
  608. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  609. diff -Naur xtcommerce.orig/admin/modules.php xtcommerce/admin/modules.php
  610. --- xtcommerce.orig/admin/modules.php 2006-12-02 13:03:53.000000000 +0100
  611. +++ xtcommerce/admin/modules.php 2010-08-10 17:58:03.000000000 +0200
  612. @@ -253,7 +253,7 @@
  613. $keys .= '<b>' . $value['title'] . '</b><br />';
  614. if ($value['use_function']) {
  615. $use_function = $value['use_function'];
  616. - if (ereg('->', $use_function)) {
  617. + if (preg_match('/->/', $use_function)) {
  618. $class_method = explode('->', $use_function);
  619. if (!is_object(${$class_method[0]})) {
  620. include(DIR_WS_CLASSES . $class_method[0] . '.php');
  621. @@ -308,4 +308,4 @@
  622. <br />
  623. </body>
  624. </html>
  625. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  626. \ No newline at end of file
  627. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  628. diff -Naur xtcommerce.orig/admin/orders_edit_other.php xtcommerce/admin/orders_edit_other.php
  629. --- xtcommerce.orig/admin/orders_edit_other.php 2006-05-07 17:56:42.000000000 +0200
  630. +++ xtcommerce/admin/orders_edit_other.php 2010-08-11 13:51:22.000000000 +0200
  631. @@ -123,7 +123,7 @@
  632. </tr>
  633.  
  634. <?php
  635. - $payments = split(';', MODULE_PAYMENT_INSTALLED);
  636. + $payments = explode(';', MODULE_PAYMENT_INSTALLED);
  637. for ($i=0; $i<count($payments); $i++){
  638.  
  639. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/payment/' . $payments[$i]);
  640. @@ -176,7 +176,7 @@
  641. </tr>
  642.  
  643. <?php
  644. - $shippings = split(';', MODULE_SHIPPING_INSTALLED);
  645. + $shippings = explode(';', MODULE_SHIPPING_INSTALLED);
  646. for ($i=0; $i<count($shippings); $i++){
  647.  
  648. if (isset($shippings[$i]) && is_file(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/' . $shippings[$i])) {
  649. @@ -190,7 +190,7 @@
  650. }
  651. }
  652.  
  653. - $order_shipping = split('_', $order->info['shipping_class']);
  654. + $order_shipping = explode('_', $order->info['shipping_class']);
  655. $order_shipping = $order_shipping[0];
  656. if (is_file(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/' . $order_shipping .'.php')) {
  657. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/shipping/' . $order_shipping .'.php');
  658. @@ -241,7 +241,7 @@
  659.  
  660.  
  661. <?php
  662. - $totals = split(';', MODULE_ORDER_TOTAL_INSTALLED);
  663. + $totals = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
  664. for ($i=0; $i<count($totals); $i++){
  665.  
  666. require(DIR_FS_LANGUAGES . $order->info['language'] . '/modules/order_total/' . $totals[$i]);
  667. @@ -288,4 +288,4 @@
  668. ?>
  669.  
  670.  
  671. -</table>
  672. \ No newline at end of file
  673. +</table>
  674. diff -Naur xtcommerce.orig/admin/orders_edit.php xtcommerce/admin/orders_edit.php
  675. --- xtcommerce.orig/admin/orders_edit.php 2006-06-30 20:23:27.000000000 +0200
  676. +++ xtcommerce/admin/orders_edit.php 2010-08-11 13:51:51.000000000 +0200
  677. @@ -526,7 +526,7 @@
  678. if ($module_name != 'shipping') {
  679. $module_tax_class = constant(MODULE_ORDER_TOTAL_.strtoupper($module_name)._TAX_CLASS);
  680. } else {
  681. - $module_tmp_name = split('_', $order->info['shipping_class']);
  682. + $module_tmp_name = explode('_', $order->info['shipping_class']);
  683. $module_tmp_name = $module_tmp_name[0];
  684. if ($module_tmp_name != 'selfpickup') {
  685. $module_tax_class = constant(MODULE_SHIPPING_.strtoupper($module_tmp_name)._TAX_CLASS);
  686. diff -Naur xtcommerce.orig/admin/server_info.php xtcommerce/admin/server_info.php
  687. --- xtcommerce.orig/admin/server_info.php 2005-04-29 04:40:58.000000000 +0200
  688. +++ xtcommerce/admin/server_info.php 2010-08-11 16:00:50.000000000 +0200
  689. @@ -103,9 +103,9 @@
  690. ob_end_clean();
  691.  
  692. $phpinfo = str_replace('border: 1px', '', $phpinfo);
  693. - ereg("(<style type=\"text/css\">{1})(.*)(</style>{1})", $phpinfo, $regs);
  694. + preg_match('/<style type=\"text\/css\">(.*)<\/style>/is', $phpinfo, $regs);
  695. echo '<style type="text/css">' . $regs[2] . '</style>';
  696. - ereg("(<body>{1})(.*)(</body>{1})", $phpinfo, $regs);
  697. + preg_match('/<body>(.*)<\/body>/is', $phpinfo, $regs);
  698. echo $regs[2];
  699. } else {
  700. phpinfo();
  701. @@ -125,4 +125,4 @@
  702. <br>
  703. </body>
  704. </html>
  705. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  706. \ No newline at end of file
  707. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  708. diff -Naur xtcommerce.orig/admin/sofortueberweisung_install.php xtcommerce/admin/sofortueberweisung_install.php
  709. --- xtcommerce.orig/admin/sofortueberweisung_install.php 2007-07-16 11:42:15.000000000 +0200
  710. +++ xtcommerce/admin/sofortueberweisung_install.php 2010-08-11 13:59:51.000000000 +0200
  711. @@ -48,11 +48,11 @@
  712. $char = chr(xtc_rand(0,255));
  713. }
  714. if ($type == 'mixed') {
  715. - if (eregi('^[a-z0-9]$', $char)) $rand_value .= $char;
  716. + if (preg_match('/^[a-z0-9]$/i', $char)) $rand_value .= $char;
  717. } elseif ($type == 'chars') {
  718. - if (eregi('^[a-z]$', $char)) $rand_value .= $char;
  719. + if (preg_match('/^[a-z]$/i', $char)) $rand_value .= $char;
  720. } elseif ($type == 'digits') {
  721. - if (ereg('^[0-9]$', $char)) $rand_value .= $char;
  722. + if (preg_match('/^[0-9]$/i', $char)) $rand_value .= $char;
  723. }
  724. }
  725.  
  726. @@ -498,4 +498,4 @@
  727. </form>
  728.  
  729. </body>
  730. -</html>
  731. \ No newline at end of file
  732. +</html>
  733. diff -Naur xtcommerce.orig/admin/stats_sales_report.php xtcommerce/admin/stats_sales_report.php
  734. --- xtcommerce.orig/admin/stats_sales_report.php 2005-10-18 14:30:40.000000000 +0200
  735. +++ xtcommerce/admin/stats_sales_report.php 2010-08-11 13:51:38.000000000 +0200
  736. @@ -315,7 +315,7 @@
  737. <option value="0"><?php echo REPORT_ALL; ?></option>
  738. <?php
  739.  
  740. - $payments = split(';', MODULE_PAYMENT_INSTALLED);
  741. + $payments = explode(';', MODULE_PAYMENT_INSTALLED);
  742. for ($i=0; $i<count($payments); $i++){
  743.  
  744. require(DIR_FS_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $payments[$i]);
  745. @@ -594,4 +594,4 @@
  746. <?php
  747. require(DIR_WS_INCLUDES . 'application_bottom.php');
  748. } // end if $srExp < 2
  749. -?>
  750. \ No newline at end of file
  751. +?>
  752. diff -Naur xtcommerce.orig/admin/whos_online.php xtcommerce/admin/whos_online.php
  753. --- xtcommerce.orig/admin/whos_online.php 2005-08-07 09:47:08.000000000 +0200
  754. +++ xtcommerce/admin/whos_online.php 2010-08-11 15:58:48.000000000 +0200
  755. @@ -85,7 +85,7 @@
  756. <td class="dataTableContent" align="center"><?php echo $whos_online['ip_address']; ?></td>
  757. <td class="dataTableContent"><?php echo date('H:i:s', $whos_online['time_entry']); ?></td>
  758. <td class="dataTableContent" align="center"><?php echo date('H:i:s', $whos_online['time_last_click']); ?></td>
  759. - <td class="dataTableContent"><?php if (eregi('^(.*)' . xtc_session_name() . '=[a-f,0-9]+[&]*(.*)', $whos_online['last_page_url'], $array)) { echo $array[1] . $array[2]; } else { echo $whos_online['last_page_url']; } ?>&nbsp;</td>
  760. + <td class="dataTableContent"><?php if (preg_match('/^(.*)' . xtc_session_name() . '=[a-f,0-9]+[&]*(.*)/i', $whos_online['last_page_url'], $array)) { echo $array[1] . $array[2]; } else { echo $whos_online['last_page_url']; } ?>&nbsp;</td>
  761. </tr>
  762. <?php
  763. }
  764. @@ -153,4 +153,4 @@
  765. <br>
  766. </body>
  767. </html>
  768. -<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  769. \ No newline at end of file
  770. +<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  771. diff -Naur xtcommerce.orig/gv_send.php xtcommerce/gv_send.php
  772. --- xtcommerce.orig/gv_send.php 2005-07-15 17:21:44.000000000 +0200
  773. +++ xtcommerce/gv_send.php 2010-08-11 14:27:15.000000000 +0200
  774. @@ -58,7 +58,7 @@
  775. $gv_result = xtc_db_fetch_array($gv_query);
  776. $customer_amount = $gv_result['amount'];
  777. $gv_amount = trim(str_replace(",", ".", $_POST['amount']));
  778. - if (ereg('[^0-9/.]', $gv_amount)) {
  779. + if (preg_match('/[^0-9/.]/', $gv_amount)) {
  780. $error = true;
  781. $error_amount = ERROR_ENTRY_AMOUNT_CHECK;
  782. }
  783. @@ -157,4 +157,4 @@
  784. $smarty->load_filter('output', 'note');
  785. $smarty->display(CURRENT_TEMPLATE.'/index.html');
  786. include ('includes/application_bottom.php');
  787. -?>
  788. \ No newline at end of file
  789. +?>
  790. diff -Naur xtcommerce.orig/inc/xtc_count_modules.inc.php xtcommerce/inc/xtc_count_modules.inc.php
  791. --- xtcommerce.orig/inc/xtc_count_modules.inc.php 2005-04-29 04:40:58.000000000 +0200
  792. +++ xtcommerce/inc/xtc_count_modules.inc.php 2010-08-11 15:17:32.000000000 +0200
  793. @@ -20,7 +20,7 @@
  794.  
  795. if (empty($modules)) return $count;
  796.  
  797. - $modules_array = split(';', $modules);
  798. + $modules_array = explode(';', $modules);
  799.  
  800. for ($i=0, $n=sizeof($modules_array); $i<$n; $i++) {
  801. $class = substr($modules_array[$i], 0, strrpos($modules_array[$i], '.'));
  802. @@ -34,4 +34,4 @@
  803.  
  804. return $count;
  805. }
  806. - ?>
  807. \ No newline at end of file
  808. + ?>
  809. diff -Naur xtcommerce.orig/inc/xtc_create_random_value.inc.php xtcommerce/inc/xtc_create_random_value.inc.php
  810. --- xtcommerce.orig/inc/xtc_create_random_value.inc.php 2005-04-29 04:40:58.000000000 +0200
  811. +++ xtcommerce/inc/xtc_create_random_value.inc.php 2010-08-11 15:20:27.000000000 +0200
  812. @@ -27,11 +27,11 @@
  813. $char = chr(xtc_rand(0,255));
  814. }
  815. if ($type == 'mixed') {
  816. - if (eregi('^[a-z0-9]$', $char)) $rand_value .= $char;
  817. + if (preg_match('/^[a-z0-9]$/i', $char)) $rand_value .= $char;
  818. } elseif ($type == 'chars') {
  819. - if (eregi('^[a-z]$', $char)) $rand_value .= $char;
  820. + if (preg_match('/^[a-z]$/i', $char)) $rand_value .= $char;
  821. } elseif ($type == 'digits') {
  822. - if (ereg('^[0-9]$', $char)) $rand_value .= $char;
  823. + if (preg_match('/^[0-9]$/', $char)) $rand_value .= $char;
  824. }
  825. }
  826.  
  827. diff -Naur xtcommerce.orig/inc/xtc_date_short.inc.php xtcommerce/inc/xtc_date_short.inc.php
  828. --- xtcommerce.orig/inc/xtc_date_short.inc.php 2005-04-29 04:40:58.000000000 +0200
  829. +++ xtcommerce/inc/xtc_date_short.inc.php 2010-08-11 15:19:20.000000000 +0200
  830. @@ -31,7 +31,7 @@
  831. if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
  832. return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
  833. } else {
  834. - return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
  835. + return preg_replace('/2037$/', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
  836. }
  837. }
  838. - ?>
  839. \ No newline at end of file
  840. + ?>
  841. diff -Naur xtcommerce.orig/inc/xtc_db_install.inc.php xtcommerce/inc/xtc_db_install.inc.php
  842. --- xtcommerce.orig/inc/xtc_db_install.inc.php 2005-04-29 04:40:58.000000000 +0200
  843. +++ xtcommerce/inc/xtc_db_install.inc.php 2010-08-11 14:26:56.000000000 +0200
  844. @@ -71,7 +71,7 @@
  845. if ($next == '') { // get the last insert query
  846. $next = 'insert';
  847. }
  848. - if ( (eregi('create', $next)) || (eregi('insert', $next)) || (eregi('drop t', $next)) ) {
  849. + if ( (preg_match('/create/i', $next)) || (preg_match('/insert/i', $next)) || (preg_match('/drop t/i', $next)) ) {
  850. $next = '';
  851. $sql_array[] = substr($restore_query, 0, $i);
  852. $restore_query = ltrim(substr($restore_query, $i+1));
  853. @@ -90,4 +90,4 @@
  854. return false;
  855. }
  856. }
  857. - ?>
  858. \ No newline at end of file
  859. + ?>
  860. diff -Naur xtcommerce.orig/inc/xtc_delete_file.inc.php xtcommerce/inc/xtc_delete_file.inc.php
  861. --- xtcommerce.orig/inc/xtc_delete_file.inc.php 2005-04-29 04:40:58.000000000 +0200
  862. +++ xtcommerce/inc/xtc_delete_file.inc.php 2010-08-11 15:19:43.000000000 +0200
  863. @@ -19,7 +19,7 @@
  864. $delete= @unlink($file);
  865. clearstatcache();
  866. if (@file_exists($file)) {
  867. - $filesys=eregi_replace("/","\\",$file);
  868. + $filesys=preg_replace("/\//","\\",$file);
  869. $delete = @system("del $filesys");
  870. clearstatcache();
  871. if (@file_exists($file)) {
  872. @@ -36,4 +36,4 @@
  873. return true;
  874. } // end function
  875. }
  876. -?>
  877. \ No newline at end of file
  878. +?>
  879. diff -Naur xtcommerce.orig/inc/xtc_parse_search_string.inc.php xtcommerce/inc/xtc_parse_search_string.inc.php
  880. --- xtcommerce.orig/inc/xtc_parse_search_string.inc.php 2005-04-29 04:40:58.000000000 +0200
  881. +++ xtcommerce/inc/xtc_parse_search_string.inc.php 2010-08-11 15:50:45.000000000 +0200
  882. @@ -19,7 +19,7 @@
  883. $search_str = trim(strtolower($search_str));
  884.  
  885. // Break up $search_str on whitespace; quoted string will be reconstructed later
  886. - $pieces = split('[[:space:]]+', $search_str);
  887. + $pieces = preg_split('/[[:space:]]+/', $search_str);
  888. $objects = array();
  889. $tmpstring = '';
  890. $flag = '';
  891. @@ -60,7 +60,7 @@
  892. */
  893.  
  894. // Add this word to the $tmpstring, starting the $tmpstring
  895. - $tmpstring = trim(ereg_replace('"', ' ', $pieces[$k]));
  896. + $tmpstring = trim(str_replace('"', ' ', $pieces[$k]));
  897.  
  898. // Check for one possible exception to the rule. That there is a single quoted word.
  899. if (substr($pieces[$k], -1 ) == '"') {
  900. @@ -110,7 +110,7 @@
  901. $piece onto the tail of the string, push the $tmpstring onto the $haves,
  902. kill the $tmpstring, turn the $flag "off", and return.
  903. */
  904. - $tmpstring .= ' ' . trim(ereg_replace('"', ' ', $pieces[$k]));
  905. + $tmpstring .= ' ' . trim(str_replace('"', ' ', $pieces[$k]));
  906.  
  907. // Push the $tmpstring onto the array of stuff to search for
  908. $objects[] = trim($tmpstring);
  909. @@ -164,4 +164,4 @@
  910. }
  911. }
  912.  
  913. - ?>
  914. \ No newline at end of file
  915. + ?>
  916. diff -Naur xtcommerce.orig/inc/xtc_redirect.inc.php xtcommerce/inc/xtc_redirect.inc.php
  917. --- xtcommerce.orig/inc/xtc_redirect.inc.php 2005-09-29 21:01:50.000000000 +0200
  918. +++ xtcommerce/inc/xtc_redirect.inc.php 2010-08-11 14:28:09.000000000 +0200
  919. @@ -26,9 +26,9 @@
  920. }
  921. }
  922.  
  923. - header('Location: ' . eregi_replace("[\r\n]+(.*)$", "", $url));
  924. + header('Location: ' . preg_replace("/[\r\n]+(.*)$/i", "", $url));
  925.  
  926. xtc_exit();
  927.  
  928. }
  929. -?>
  930. \ No newline at end of file
  931. +?>
  932. diff -Naur xtcommerce.orig/inc/xtc_remove_non_numeric.inc.php xtcommerce/inc/xtc_remove_non_numeric.inc.php
  933. --- xtcommerce.orig/inc/xtc_remove_non_numeric.inc.php 2005-03-12 21:34:16.000000000 +0100
  934. +++ xtcommerce/inc/xtc_remove_non_numeric.inc.php 2010-08-11 14:27:45.000000000 +0200
  935. @@ -17,7 +17,7 @@
  936.  
  937. function xtc_remove_non_numeric($var)
  938. {
  939. - $var=ereg_replace('[^0-9]','',$var);
  940. + $var=preg_replace('/[^0-9]/','',$var);
  941. return $var;
  942. }
  943. - ?>
  944. \ No newline at end of file
  945. + ?>
  946. diff -Naur xtcommerce.orig/inc/xtc_Security.inc.php xtcommerce/inc/xtc_Security.inc.php
  947. --- xtcommerce.orig/inc/xtc_Security.inc.php 2005-07-14 19:55:10.000000000 +0200
  948. +++ xtcommerce/inc/xtc_Security.inc.php 2010-08-11 15:16:58.000000000 +0200
  949. @@ -53,19 +53,19 @@
  950. //echo '</pre>';
  951. foreach ($_GET as $secvalue) {
  952. if (!is_array($secvalue)) {
  953. - if ((eregi("<[^>]*script.*\"?[^>]*>", $secvalue)) ||
  954. - (eregi(".*[[:space:]](or|and)[[:space:]].*(=|like).*", $secvalue)) ||
  955. - (eregi("<[^>]*object.*\"?[^>]*>", $secvalue)) ||
  956. - (eregi("<[^>]*iframe.*\"?[^>]*>", $secvalue)) ||
  957. - (eregi("<[^>]*applet.*\"?[^>]*>", $secvalue)) ||
  958. - (eregi("<[^>]*meta.*\"?[^>]*>", $secvalue)) ||
  959. - (eregi("<[^>]*style.*\"?[^>]*>", $secvalue)) ||
  960. - (eregi("<[^>]*form.*\"?[^>]*>", $secvalue)) ||
  961. - (eregi("<[^>]*window.*\"?[^>]*>", $secvalue)) ||
  962. - (eregi("<[^>]*alert.*\"?[^>]*>", $secvalue)) ||
  963. - (eregi("<[^>]*img.*\"?[^>]*>", $secvalue)) ||
  964. - (eregi("<[^>]*document.*\"?[^>]*>", $secvalue)) ||
  965. - (eregi("<[^>]*cookie.*\"?[^>]*>", $secvalue))) {
  966. + if ((preg_match("/<[^>]*script.*\"?[^>]*>/i", $secvalue)) ||
  967. + (preg_match("/.*[[:space:]](or|and)[[:space:]].*(=|like).*/i", $secvalue)) ||
  968. + (preg_match("/<[^>]*object.*\"?[^>]*>/i", $secvalue)) ||
  969. + (preg_match("/<[^>]*iframe.*\"?[^>]*>/i", $secvalue)) ||
  970. + (preg_match("/<[^>]*applet.*\"?[^>]*>/i", $secvalue)) ||
  971. + (preg_match("/<[^>]*meta.*\"?[^>]*>/i", $secvalue)) ||
  972. + (preg_match("/<[^>]*style.*\"?[^>]*>/i", $secvalue)) ||
  973. + (preg_match("/<[^>]*form.*\"?[^>]*>/i", $secvalue)) ||
  974. + (preg_match("/<[^>]*window.*\"?[^>]*>/i", $secvalue)) ||
  975. + (preg_match("/<[^>]*alert.*\"?[^>]*>/i", $secvalue)) ||
  976. + (preg_match("/<[^>]*img.*\"?[^>]*>/i", $secvalue)) ||
  977. + (preg_match("/<[^>]*document.*\"?[^>]*>/i", $secvalue)) ||
  978. + (preg_match("/<[^>]*cookie.*\"?[^>]*>/i", $secvalue))) {
  979. xtcMailHackAttempt(__FILE__,__LINE__,'xt:C Security Alert','Intrusion detection.');
  980. xtc_redirect(FILENAME_DEFAULT);
  981. }
  982. @@ -77,15 +77,15 @@
  983. if ( count($_POST) > 0) {
  984. foreach ($_POST as $secvalue) {
  985. if (!is_array($secvalue)) {
  986. - if ((eregi("<[^>]*script.*\"?[^>]*>", $secvalue)) ||
  987. - (eregi("<[^>]*object.*\"?[^>]*>", $secvalue)) ||
  988. - (eregi("<[^>]*iframe.*\"?[^>]*>", $secvalue)) ||
  989. - (eregi("<[^>]*applet.*\"?[^>]*>", $secvalue)) ||
  990. - (eregi("<[^>]*window.*\"?[^>]*>", $secvalue)) ||
  991. - (eregi("<[^>]*alert.*\"?[^>]*>", $secvalue)) ||
  992. - (eregi("<[^>]*document.*\"?[^>]*>", $secvalue)) ||
  993. - (eregi("<[^>]*cookie.*\"?[^>]*>", $secvalue)) ||
  994. - (eregi("<[^>]*meta.*\"?[^>]*>", $secvalue))
  995. + if ((preg_match("/<[^>]*script.*\"?[^>]*>/i", $secvalue)) ||
  996. + (preg_match("/<[^>]*object.*\"?[^>]*>/i", $secvalue)) ||
  997. + (preg_match("/<[^>]*iframe.*\"?[^>]*>/i", $secvalue)) ||
  998. + (preg_match("/<[^>]*applet.*\"?[^>]*>/i", $secvalue)) ||
  999. + (preg_match("/<[^>]*window.*\"?[^>]*>/i", $secvalue)) ||
  1000. + (preg_match("/<[^>]*alert.*\"?[^>]*>/i", $secvalue)) ||
  1001. + (preg_match("/<[^>]*document.*\"?[^>]*>/i", $secvalue)) ||
  1002. + (preg_match("/<[^>]*cookie.*\"?[^>]*>/i", $secvalue)) ||
  1003. + (preg_match("/<[^>]*meta.*\"?[^>]*>/i", $secvalue))
  1004. ) {
  1005.  
  1006. xtcMailHackAttempt(__FILE__,__LINE__,'xt:C Security Alert','Intrusion detection.');
  1007. @@ -99,19 +99,19 @@
  1008. if ( count($_COOKIE) > 0) {
  1009. foreach ($_COOKIE as $secvalue) {
  1010. if (!is_array($secvalue)) {
  1011. - if ((eregi("<[^>]*script.*\"?[^>]*>", $secvalue)) ||
  1012. - (eregi(".*[[:space:]](or|and)[[:space:]].*(=|like).*", $secvalue)) ||
  1013. - (eregi("<[^>]*object.*\"?[^>]*>", $secvalue)) ||
  1014. - (eregi("<[^>]*iframe.*\"?[^>]*>", $secvalue)) ||
  1015. - (eregi("<[^>]*applet.*\"?[^>]*>", $secvalue)) ||
  1016. - (eregi("<[^>]*meta.*\"?[^>]*>", $secvalue)) ||
  1017. - (eregi("<[^>]*style.*\"?[^>]*>", $secvalue)) ||
  1018. - (eregi("<[^>]*form.*\"?[^>]*>", $secvalue)) ||
  1019. - (eregi("<[^>]*window.*\"?[^>]*>", $secvalue)) ||
  1020. - (eregi("<[^>]*alert.*\"?[^>]*>", $secvalue)) ||
  1021. - (eregi("<[^>]*document.*\"?[^>]*>", $secvalue)) ||
  1022. - (eregi("<[^>]*cookie.*\"?[^>]*>", $secvalue)) ||
  1023. - (eregi("<[^>]*img.*\"?[^>]*>", $secvalue))
  1024. + if ((preg_match("/<[^>]*script.*\"?[^>]*>/i", $secvalue)) ||
  1025. + (preg_match("/.*[[:space:]](or|and)[[:space:]].*(=|like).*/i", $secvalue)) ||
  1026. + (preg_match("/<[^>]*object.*\"?[^>]*>/i", $secvalue)) ||
  1027. + (preg_match("/<[^>]*iframe.*\"?[^>]*>/i", $secvalue)) ||
  1028. + (preg_match("/<[^>]*applet.*\"?[^>]*>/i", $secvalue)) ||
  1029. + (preg_match("/<[^>]*meta.*\"?[^>]*>/i", $secvalue)) ||
  1030. + (preg_match("/<[^>]*style.*\"?[^>]*>/i", $secvalue)) ||
  1031. + (preg_match("/<[^>]*form.*\"?[^>]*>/i", $secvalue)) ||
  1032. + (preg_match("/<[^>]*window.*\"?[^>]*>/i", $secvalue)) ||
  1033. + (preg_match("/<[^>]*alert.*\"?[^>]*>/i", $secvalue)) ||
  1034. + (preg_match("/<[^>]*document.*\"?[^>]*>/i", $secvalue)) ||
  1035. + (preg_match("/<[^>]*cookie.*\"?[^>]*>/i", $secvalue)) ||
  1036. + (preg_match("/<[^>]*img.*\"?[^>]*>/i", $secvalue))
  1037. ) {
  1038.  
  1039. xtcMailHackAttempt(__FILE__,__LINE__,'xt:C Security Alert','Intrusion detection.');
  1040. @@ -259,4 +259,4 @@
  1041. }
  1042.  
  1043.  
  1044. -?>
  1045. \ No newline at end of file
  1046. +?>
  1047. diff -Naur xtcommerce.orig/inc/xtc_validate_email.inc.php xtcommerce/inc/xtc_validate_email.inc.php
  1048. --- xtcommerce.orig/inc/xtc_validate_email.inc.php 2005-04-29 04:40:58.000000000 +0200
  1049. +++ xtcommerce/inc/xtc_validate_email.inc.php 2010-08-11 15:41:59.000000000 +0200
  1050. @@ -49,22 +49,22 @@
  1051. function xtc_validate_email($email) {
  1052. $valid_address = true;
  1053.  
  1054. - $mail_pat = '^(.+)@(.+)$';
  1055. + $mail_pat = '/^(.+)@(.+)$/i';
  1056. $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
  1057. $atom = "$valid_chars+";
  1058. $quoted_user='(\"[^\"]*\")';
  1059. $word = "($atom|$quoted_user)";
  1060. - $user_pat = "^$word(\.$word)*$";
  1061. - $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
  1062. - $domain_pat = "^$atom(\.$atom)*$";
  1063. + $user_pat = "/^$word(\.$word)*$/i";
  1064. + $ip_domain_pat='/^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$/i';
  1065. + $domain_pat = "/^$atom(\.$atom)*$/i";
  1066.  
  1067. - if (eregi($mail_pat, $email, $components)) {
  1068. + if (preg_match($mail_pat, $email, $components)) {
  1069. $user = $components[1];
  1070. $domain = $components[2];
  1071. // validate user
  1072. - if (eregi($user_pat, $user)) {
  1073. + if (preg_match($user_pat, $user)) {
  1074. // validate domain
  1075. - if (eregi($ip_domain_pat, $domain, $ip_components)) {
  1076. + if (preg_match($ip_domain_pat, $domain, $ip_components)) {
  1077. // this is an IP address
  1078. for ($i=1;$i<=4;$i++) {
  1079. if ($ip_components[$i] > 255) {
  1080. @@ -74,7 +74,7 @@
  1081. }
  1082. } else {
  1083. // Domain is a name, not an IP
  1084. - if (eregi($domain_pat, $domain)) {
  1085. + if (preg_match($domain_pat, $domain)) {
  1086. /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD
  1087. and that there's a hostname preceding the domain or country. */
  1088. $domain_components = explode(".", $domain);
  1089. @@ -84,7 +84,7 @@
  1090. } else {
  1091. $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);
  1092. // Allow all 2-letter TLDs (ccTLDs)
  1093. - if (eregi('^[a-z][a-z]$', $top_level_domain) != 1) {
  1094. + if (preg_match('/^[a-z][a-z]$/i', $top_level_domain) != 1) {
  1095. $tld_pattern = '';
  1096. // Get authorized TLDs from text file
  1097. $tlds = file(DIR_FS_INC.'tld.txt');
  1098. @@ -93,13 +93,13 @@
  1099. $words = explode('#', $line);
  1100. $tld = trim($words[0]);
  1101. // TLDs should be 3 letters or more
  1102. - if (eregi('^[a-z]{3,}$', $tld) == 1) {
  1103. + if (preg_match('/^[a-z]{3,}$/i', $tld) == 1) {
  1104. $tld_pattern .= '^' . $tld . '$|';
  1105. }
  1106. }
  1107. // Remove last '|'
  1108. $tld_pattern = substr($tld_pattern, 0, -1);
  1109. - if (eregi("$tld_pattern", $top_level_domain) == 0) {
  1110. + if (preg_match("/$tld_pattern/i", $top_level_domain) == 0) {
  1111. $valid_address = false;
  1112. }
  1113. }
  1114. @@ -122,4 +122,4 @@
  1115. return $valid_address;
  1116. }
  1117.  
  1118. -?>
  1119. \ No newline at end of file
  1120. +?>
  1121. diff -Naur xtcommerce.orig/inc/xtc_word_count.inc.php xtcommerce/inc/xtc_word_count.inc.php
  1122. --- xtcommerce.orig/inc/xtc_word_count.inc.php 2005-04-29 04:40:58.000000000 +0200
  1123. +++ xtcommerce/inc/xtc_word_count.inc.php 2010-08-11 14:27:27.000000000 +0200
  1124. @@ -17,8 +17,8 @@
  1125.  
  1126. // Get the number of times a word/character is present in a string
  1127. function xtc_word_count($string, $needle) {
  1128. - $temp_array = split($needle, $string);
  1129. + $temp_array = explode($needle, $string);
  1130.  
  1131. return sizeof($temp_array);
  1132. }
  1133. -?>
  1134. \ No newline at end of file
  1135. +?>
  1136. diff -Naur xtcommerce.orig/includes/classes/afterbuy.php xtcommerce/includes/classes/afterbuy.php
  1137. --- xtcommerce.orig/includes/classes/afterbuy.php 2005-10-07 12:41:04.000000000 +0200
  1138. +++ xtcommerce/includes/classes/afterbuy.php 2010-08-11 15:31:45.000000000 +0200
  1139. @@ -68,9 +68,9 @@
  1140. $customer['firma'] = $oData['billing_company'];
  1141. $customer['vorname'] = $oData['billing_firstname'];
  1142. $customer['nachname'] = $oData['billing_lastname'];
  1143. - $customer['strasse'] = ereg_replace(" ", "%20", $oData['billing_street_address']);
  1144. + $customer['strasse'] = preg_replace("/ /", "%20", $oData['billing_street_address']);
  1145. $customer['plz'] = $oData['billing_postcode'];
  1146. - $customer['ort'] = ereg_replace(" ", "%20", $oData['billing_city']);
  1147. + $customer['ort'] = preg_replace("/ /", "%20", $oData['billing_city']);
  1148. $customer['tel'] = $oData['billing_telephone'];
  1149. $customer['fax'] = "";
  1150. $customer['mail'] = $oData['customers_email_address'];
  1151. @@ -92,9 +92,9 @@
  1152. $customer['d_firma'] = $oData['delivery_company'];
  1153. $customer['d_vorname'] = $oData['delivery_firstname'];
  1154. $customer['d_nachname'] = $oData['delivery_lastname'];
  1155. - $customer['d_strasse'] = ereg_replace(" ", "%20", $oData['delivery_street_address']);
  1156. + $customer['d_strasse'] = preg_replace("/ /", "%20", $oData['delivery_street_address']);
  1157. $customer['d_plz'] = $oData['delivery_postcode'];
  1158. - $customer['d_ort'] = ereg_replace(" ", "%20", $oData['delivery_city']);
  1159. + $customer['d_ort'] = preg_replace("/ /", "%20", $oData['delivery_city']);
  1160. $customer['d_land'] = $oData['delivery_country_iso_code_2'];
  1161.  
  1162. // get products related to order
  1163. @@ -138,12 +138,12 @@
  1164. if ($artnr == '')
  1165. $artnr = $pDATA['products_id'];
  1166. $DATAstring .= "Artikelnr_".$nr."=".$artnr."&";
  1167. - $DATAstring .= "Artikelname_".$nr."=".ereg_replace("&", "%38", ereg_replace("\"", "", ereg_replace(" ", "%20", $pDATA['products_name'])))."&";
  1168. + $DATAstring .= "Artikelname_".$nr."=".preg_replace("/&/", "%38", preg_replace("/\"/", "", preg_replace("/ /", "%20", $pDATA['products_name'])))."&";
  1169.  
  1170. if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) $pDATA['products_price']+=$pDATA['products_tax'];
  1171. if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 0) $pDATA['products_tax']=0;
  1172. - $price = ereg_replace("\.", ",", $pDATA['products_price']);
  1173. - $tax = ereg_replace("\.", ",", $pDATA['products_tax']);
  1174. + $price = preg_replace("/\./", ",", $pDATA['products_price']);
  1175. + $tax = preg_replace("/\./", ",", $pDATA['products_tax']);
  1176.  
  1177. $DATAstring .= "ArtikelEPreis_".$nr."=".$price."&";
  1178. $DATAstring .= "ArtikelMwst_".$nr."=".$tax."&";
  1179. @@ -218,7 +218,7 @@
  1180. $nr ++;
  1181. $DATAstring .= "Artikelnr_".$nr."=99999999&";
  1182. $DATAstring .= "Artikelname_".$nr."=Nachname&";
  1183. - $cod_fee = ereg_replace("\.", ",", $cod_fee);
  1184. + $cod_fee = preg_replace("/\./", ",", $cod_fee);
  1185. $DATAstring .= "ArtikelEPreis_".$nr."=".$cod_fee."&";
  1186. $DATAstring .= "ArtikelMwst_".$nr."=".$tax."&";
  1187. $DATAstring .= "ArtikelMenge_".$nr."=1&";
  1188. @@ -230,7 +230,7 @@
  1189. $nr ++;
  1190. $DATAstring .= "Artikelnr_".$nr."=99999998&";
  1191. $DATAstring .= "Artikelname_".$nr."=Rabatt&";
  1192. - $discount = ereg_replace("\.", ",", $discount);
  1193. + $discount = preg_replace("/\./", ",", $discount);
  1194. $DATAstring .= "ArtikelEPreis_".$nr."=".$discount."&";
  1195. $DATAstring .= "ArtikelMwst_".$nr."=".$tax."&";
  1196. $DATAstring .= "ArtikelMenge_".$nr."=1&";
  1197. @@ -241,7 +241,7 @@
  1198. $nr ++;
  1199. $DATAstring .= "Artikelnr_".$nr."=99999997&";
  1200. $DATAstring .= "Artikelname_".$nr."=Gutschein&";
  1201. - $gv = ereg_replace("\.", ",", ($gv * (-1)));
  1202. + $gv = preg_replace("/\./", ",", ($gv * (-1)));
  1203. $DATAstring .= "ArtikelEPreis_".$nr."=".$gv."&";
  1204. $DATAstring .= "ArtikelMwst_".$nr."=0&";
  1205. $DATAstring .= "ArtikelMenge_".$nr."=1&";
  1206. @@ -252,7 +252,7 @@
  1207. $nr ++;
  1208. $DATAstring .= "Artikelnr_".$nr."=99999996&";
  1209. $DATAstring .= "Artikelname_".$nr."=Kupon&";
  1210. - $coupon = ereg_replace("\.", ",", ($coupon * (-1)));
  1211. + $coupon = preg_replace("/\./", ",", ($coupon * (-1)));
  1212. $DATAstring .= "ArtikelEPreis_".$nr."=".$coupon."&";
  1213. $DATAstring .= "ArtikelMwst_".$nr."=0&";
  1214. $DATAstring .= "ArtikelMenge_".$nr."=1&";
  1215. @@ -261,7 +261,7 @@
  1216.  
  1217. $DATAstring .= "PosAnz=".$p_count."&";
  1218.  
  1219. - $vK = ereg_replace("\.", ",", $shipping);
  1220. + $vK = preg_replace("/\./", ",", $shipping);
  1221.  
  1222. if ($oData['payment_method'] == 'cod')
  1223. $oData['payment_method'] = 'Nachnahme';
  1224. @@ -295,7 +295,7 @@
  1225. curl_setopt($ch, CURLOPT_POSTFIELDS, $DATAstring);
  1226. $result = curl_exec($ch);
  1227.  
  1228. - if (ereg("<success>1</success>", $result)) {
  1229. + if (preg_match("/<success>1<\/success>/", $result)) {
  1230. // result ok, mark order
  1231. // extract ID from result
  1232. $cdr = explode('<KundenNr>', $result);
  1233. @@ -332,4 +332,4 @@
  1234. }
  1235.  
  1236. }
  1237. -?>
  1238. \ No newline at end of file
  1239. +?>
  1240. diff -Naur xtcommerce.orig/includes/classes/banktransfer_validation.php xtcommerce/includes/classes/banktransfer_validation.php
  1241. --- xtcommerce.orig/includes/classes/banktransfer_validation.php 2006-05-10 20:04:32.000000000 +0200
  1242. +++ xtcommerce/includes/classes/banktransfer_validation.php 2010-08-11 15:14:22.000000000 +0200
  1243. @@ -2085,8 +2085,8 @@
  1244.  
  1245. /* -------- Dies ist die wichtigste function ---------- */
  1246. function CheckAccount($banktransfer_number, $banktransfer_blz) {
  1247. - $KontoNR = ereg_replace('[^0-9]', '', $banktransfer_number);
  1248. - $BLZ = ereg_replace('[^0-9]', '', $banktransfer_blz);
  1249. + $KontoNR = preg_replace('/[^0-9]/', '', $banktransfer_number);
  1250. + $BLZ = preg_replace('/[^0-9]/', '', $banktransfer_blz);
  1251.  
  1252. $Result = 0;
  1253. if ($BLZ == '' || strlen($BLZ) < 8) {
  1254. @@ -2133,4 +2133,4 @@
  1255. return $Result;
  1256. } /* End of CheckAccount */
  1257. } /* End Class AccountCheck */
  1258. -?>
  1259. \ No newline at end of file
  1260. +?>
  1261. diff -Naur xtcommerce.orig/includes/classes/cc_validation.php xtcommerce/includes/classes/cc_validation.php
  1262. --- xtcommerce.orig/includes/classes/cc_validation.php 2005-07-17 17:25:32.000000000 +0200
  1263. +++ xtcommerce/includes/classes/cc_validation.php 2010-08-11 14:09:06.000000000 +0200
  1264. @@ -20,39 +20,39 @@
  1265. var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year;
  1266.  
  1267. function validate($number, $expiry_m, $expiry_y) {
  1268. - $this->cc_number = ereg_replace('[^0-9]', '', $number);
  1269. + $this->cc_number = preg_replace('/[^0-9]/', '', $number);
  1270.  
  1271. - if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {
  1272. + if (preg_match('/^4[0-9]{12}([0-9]{3})?$/', $this->cc_number)) {
  1273. $this->cc_type = 'Visa';
  1274. if (strtolower(MODULE_PAYMENT_CC_ACCEPT_VISA) != 'true')
  1275. return -8;
  1276. }
  1277. - elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) {
  1278. + elseif (preg_match('/^5[1-5][0-9]{14}$/', $this->cc_number)) {
  1279. $this->cc_type = 'Master Card';
  1280. if (strtolower(MODULE_PAYMENT_CC_ACCEPT_MASTERCARD) != 'true')
  1281. return -8;
  1282. }
  1283. - elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {
  1284. + elseif (preg_match('/^3[47][0-9]{13}$/', $this->cc_number)) {
  1285. $this->cc_type = 'American Express';
  1286. if (strtolower(MODULE_PAYMENT_CC_ACCEPT_AMERICANEXPRESS) != 'true')
  1287. return -8;
  1288. }
  1289. - elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) {
  1290. + elseif (preg_match('/^3(0[0-5]|[68][0-9])[0-9]{11}$/', $this->cc_number)) {
  1291. $this->cc_type = 'Diners Club';
  1292. if (strtolower(MODULE_PAYMENT_CC_ACCEPT_DINERSCLUB) != 'true')
  1293. return -8;
  1294. }
  1295. - elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) {
  1296. + elseif (preg_match('/^6011[0-9]{12}$/', $this->cc_number)) {
  1297. $this->cc_type = 'Discover';
  1298. if (strtolower(MODULE_PAYMENT_CC_ACCEPT_DISCOVERNOVUS) != 'true')
  1299. return -8;
  1300. }
  1301. - elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) {
  1302. + elseif (preg_match('/^(3[0-9]{4}|2131|1800)[0-9]{11}$/', $this->cc_number)) {
  1303. $this->cc_type = 'JCB';
  1304. if (strtolower(MODULE_PAYMENT_CC_ACCEPT_JCB) != 'true')
  1305. return -8;
  1306. }
  1307. - elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) {
  1308. + elseif (preg_match('/^5610[0-9]{12}$/', $this->cc_number)) {
  1309. $this->cc_type = 'Australian BankCard';
  1310. if (strtolower(MODULE_PAYMENT_CC_ACCEPT_OZBANKCARD) != 'true')
  1311. return -8;
  1312. @@ -109,4 +109,4 @@
  1313. return ($numSum % 10 == 0);
  1314. }
  1315. }
  1316. -?>
  1317. \ No newline at end of file
  1318. +?>
  1319. diff -Naur xtcommerce.orig/includes/classes/class.inputfilter.php xtcommerce/includes/classes/class.inputfilter.php
  1320. --- xtcommerce.orig/includes/classes/class.inputfilter.php 2007-05-25 12:21:32.000000000 +0200
  1321. +++ xtcommerce/includes/classes/class.inputfilter.php 2010-08-11 14:50:16.000000000 +0200
  1322. @@ -228,7 +228,7 @@
  1323. $attrSubSet = explode('=', trim($attrSet[$i]));
  1324. list ($attrSubSet[0]) = explode(' ', $attrSubSet[0]);
  1325. // removes all "non-regular" attr names AND also attr blacklisted
  1326. - if ((!eregi("^[a-z]*$", $attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on'))))
  1327. + if ((!preg_match("/^[a-z]*$/i", $attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on'))))
  1328. continue;
  1329. // xss attr value filtering
  1330. if ($attrSubSet[1]) {
  1331. @@ -348,4 +348,4 @@
  1332. return $string;
  1333. }
  1334. }
  1335. -?>
  1336. \ No newline at end of file
  1337. +?>
  1338. diff -Naur xtcommerce.orig/includes/classes/http_client.php xtcommerce/includes/classes/http_client.php
  1339. --- xtcommerce.orig/includes/classes/http_client.php 2005-04-29 04:40:58.000000000 +0200
  1340. +++ xtcommerce/includes/classes/http_client.php 2010-08-11 14:09:32.000000000 +0200
  1341. @@ -390,7 +390,7 @@
  1342. $str = fgets($this->socket, 1024);
  1343. $finished = ($str == $lastLine);
  1344. if (!$finished) {
  1345. - list($hdr, $value) = split(': ', $str, 2);
  1346. + list($hdr, $value) = explode(': ', $str, 2);
  1347. // nasty workaround broken multiple same headers (eg. Set-Cookie headers) @FIXME
  1348. if (isset($headers[$hdr])) {
  1349. $headers[$hdr] .= '; ' . trim($value);
  1350. @@ -460,4 +460,4 @@
  1351. return $requesturi;
  1352. }
  1353. }
  1354. -?>
  1355. \ No newline at end of file
  1356. +?>
  1357. diff -Naur xtcommerce.orig/includes/classes/language.php xtcommerce/includes/classes/language.php
  1358. --- xtcommerce.orig/includes/classes/language.php 2005-05-27 19:27:02.000000000 +0200
  1359. +++ xtcommerce/includes/classes/language.php 2010-08-11 14:10:26.000000000 +0200
  1360. @@ -93,7 +93,7 @@
  1361. for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
  1362. reset($this->languages);
  1363. while (list($key, $value) = each($this->languages)) {
  1364. - if (eregi('^(' . $value[0] . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
  1365. + if (preg_match('/^(' . $value[0] . ')(;q=[0-9]\\.[0-9])?$/i', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
  1366. $this->language = $this->catalog_languages[$key];
  1367. break 2;
  1368. }
  1369. @@ -101,4 +101,4 @@
  1370. }
  1371. }
  1372. }
  1373. -?>
  1374. \ No newline at end of file
  1375. +?>
  1376. diff -Naur xtcommerce.orig/includes/classes/sessions.php xtcommerce/includes/classes/sessions.php
  1377. --- xtcommerce.orig/includes/classes/sessions.php 2005-04-29 04:40:58.000000000 +0200
  1378. +++ xtcommerce/includes/classes/sessions.php 2010-08-11 14:23:27.000000000 +0200
  1379. @@ -386,7 +386,7 @@
  1380. // '<session-name>=<session-id>' to allow URLs of the form
  1381. // http://yoursite/<session-name>=<session-id>/script.php
  1382. if (empty($session->id)) {
  1383. - eregi($session->name . '=([^/]+)', $GLOBALS['REQUEST_URI'], $regs);
  1384. + preg_match('/' . $session->name . '=([^/]+)/i', $GLOBALS['REQUEST_URI'], $regs);
  1385. $regs[1] = trim($regs[1]);
  1386. if (!empty($regs[1])) {
  1387. $session->id = $regs[1];
  1388. @@ -516,4 +516,4 @@
  1389. }
  1390.  
  1391. register_shutdown_function('session_close');
  1392. -?>
  1393. \ No newline at end of file
  1394. +?>
  1395. diff -Naur xtcommerce.orig/includes/classes/shopping_cart.php xtcommerce/includes/classes/shopping_cart.php
  1396. --- xtcommerce.orig/includes/classes/shopping_cart.php 2006-08-20 21:39:44.000000000 +0200
  1397. +++ xtcommerce/includes/classes/shopping_cart.php 2010-08-11 15:32:07.000000000 +0200
  1398. @@ -461,7 +461,7 @@
  1399. $no_count = false;
  1400. $gv_query = xtc_db_query("select products_model from ".TABLE_PRODUCTS." where products_id = '".$products_id."'");
  1401. $gv_result = xtc_db_fetch_array($gv_query);
  1402. - if (ereg('^GIFT', $gv_result['products_model'])) {
  1403. + if (preg_match('/^GIFT/', $gv_result['products_model'])) {
  1404. $no_count = true;
  1405. }
  1406. if (NO_COUNT_ZERO_WEIGHT == 1) {
  1407. @@ -480,4 +480,4 @@
  1408. // ------------------------ ICW CREDIT CLASS Gift Voucher Addittion-------------------------------End
  1409. //GV Code End
  1410. }
  1411. -?>
  1412. \ No newline at end of file
  1413. +?>
  1414. diff -Naur xtcommerce.orig/includes/classes/Smarty_2.6.14/plugins/function.fetch.php xtcommerce/includes/classes/Smarty_2.6.14/plugins/function.fetch.php
  1415. --- xtcommerce.orig/includes/classes/Smarty_2.6.14/plugins/function.fetch.php 2005-10-11 18:22:56.000000000 +0200
  1416. +++ xtcommerce/includes/classes/Smarty_2.6.14/plugins/function.fetch.php 2010-08-11 15:28:37.000000000 +0200
  1417. @@ -181,12 +181,12 @@
  1418. $content .= fgets($fp,4096);
  1419. }
  1420. fclose($fp);
  1421. - $csplit = split("\r\n\r\n",$content,2);
  1422. + $csplit = explode("\r\n\r\n",$content,2);
  1423.  
  1424. $content = $csplit[1];
  1425.  
  1426. if(!empty($params['assign_headers'])) {
  1427. - $smarty->assign($params['assign_headers'],split("\r\n",$csplit[0]));
  1428. + $smarty->assign($params['assign_headers'],explode("\r\n",$csplit[0]));
  1429. }
  1430. }
  1431. } else {
  1432. diff -Naur xtcommerce.orig/includes/econda/econda.php xtcommerce/includes/econda/econda.php
  1433. --- xtcommerce.orig/includes/econda/econda.php 2006-08-02 21:47:21.000000000 +0200
  1434. +++ xtcommerce/includes/econda/econda.php 2010-08-11 15:29:09.000000000 +0200
  1435. @@ -87,7 +87,7 @@
  1436. }
  1437.  
  1438. // $current_page = basename($PHP_SELF);
  1439. -// $current_page = split('\?', basename($_SERVER['PHP_SELF'])); $current_page = $current_page[0]; // for BadBlue(Win32) webserver compatibility
  1440. +// $current_page = explode('?', basename($_SERVER['PHP_SELF'])); $current_page = $current_page[0]; // for BadBlue(Win32) webserver compatibility
  1441. $current_page = join('',preg_grep("/.+\.php$/", preg_split("/\?|\//", $_SERVER['PHP_SELF'])));
  1442. switch ($current_page) {
  1443. case FILENAME_PRODUCT_INFO:
  1444. diff -Naur xtcommerce.orig/includes/functions/compatibility.php xtcommerce/includes/functions/compatibility.php
  1445. --- xtcommerce.orig/includes/functions/compatibility.php 2005-04-29 04:40:58.000000000 +0200
  1446. +++ xtcommerce/includes/functions/compatibility.php 2010-08-11 15:20:54.000000000 +0200
  1447. @@ -115,7 +115,7 @@
  1448.  
  1449. if (!function_exists('is_numeric')) {
  1450. function is_numeric($param) {
  1451. - return ereg('^[0-9]{1,50}.?[0-9]{0,50}$', $param);
  1452. + return preg_match('/^[0-9]{1,50}.?[0-9]{0,50}$/', $param);
  1453. }
  1454. }
  1455.  
  1456. @@ -165,7 +165,7 @@
  1457. if(xtc_not_null($host) && xtc_not_null($type)) {
  1458. @exec("nslookup -type=$type $host", $output);
  1459. while(list($k, $line) = each($output)) {
  1460. - if(eregi("^$host", $line)) {
  1461. + if(preg_match("/^$host/i", $line)) {
  1462. return true;
  1463. }
  1464. }
  1465. @@ -173,4 +173,4 @@
  1466. return false;
  1467. }
  1468. }
  1469. -?>
  1470. \ No newline at end of file
  1471. +?>
  1472. diff -Naur xtcommerce.orig/includes/functions/sessions.php xtcommerce/includes/functions/sessions.php
  1473. --- xtcommerce.orig/includes/functions/sessions.php 2005-08-28 23:10:52.000000000 +0200
  1474. +++ xtcommerce/includes/functions/sessions.php 2010-08-11 15:57:51.000000000 +0200
  1475. @@ -80,16 +80,22 @@
  1476. global $session_started;
  1477.  
  1478. if ($session_started == true) {
  1479. - return session_register($variable);
  1480. + if (isset($GLOBALS[$variable]))
  1481. + $_SESSION[$variable] =& $GLOBALS[$variable];
  1482. + else
  1483. + $_SESSION[$variable] = null;
  1484. }
  1485. }
  1486.  
  1487. function xtc_session_is_registered($variable) {
  1488. - return session_is_registered($variable);
  1489. + return array_key_exists($variable, $_SESSION);
  1490. }
  1491.  
  1492. function xtc_session_unregister($variable) {
  1493. - return session_unregister($variable);
  1494. + if (!xtc_session_is_registered($variable))
  1495. + return false;
  1496. + unset($_SESSION[$variable]);
  1497. + return true;
  1498. }
  1499.  
  1500. function xtc_session_id($sessid = '') {
  1501. @@ -144,4 +150,4 @@
  1502. unset($session_backup);
  1503.  
  1504. }
  1505. -?>
  1506. \ No newline at end of file
  1507. +?>
  1508. diff -Naur xtcommerce.orig/includes/iclear/nusoap.php xtcommerce/includes/iclear/nusoap.php
  1509. --- xtcommerce.orig/includes/iclear/nusoap.php 2006-07-27 19:07:12.000000000 +0200
  1510. +++ xtcommerce/includes/iclear/nusoap.php 2010-08-11 15:59:29.000000000 +0200
  1511. @@ -503,7 +503,7 @@
  1512. case (is_array($val) || $type):
  1513. // detect if struct or array
  1514. $valueType = $this->isArraySimpleOrStruct($val);
  1515. - if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
  1516. + if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){
  1517. $i = 0;
  1518. if(is_array($val) && count($val)> 0){
  1519. foreach($val as $v){
  1520. @@ -698,7 +698,7 @@
  1521. */
  1522. function expandQname($qname){
  1523. // get element prefix
  1524. - if(strpos($qname,':') && !ereg('^http://',$qname)){
  1525. + if(strpos($qname,':') && !preg_match('/^http:\/\//',$qname)){
  1526. // get unqualified name
  1527. $name = substr(strstr($qname,':'),1);
  1528. // get ns prefix
  1529. @@ -826,7 +826,7 @@
  1530. function timestamp_to_iso8601($timestamp,$utc=true){
  1531. $datestr = date('Y-m-d\TH:i:sO',$timestamp);
  1532. if($utc){
  1533. - $eregStr =
  1534. + $regStr =
  1535. '([0-9]{4})-'. // centuries & years CCYY-
  1536. '([0-9]{2})-'. // months MM-
  1537. '([0-9]{2})'. // days DD
  1538. @@ -836,7 +836,7 @@
  1539. '([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss...
  1540. '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
  1541.  
  1542. - if(ereg($eregStr,$datestr,$regs)){
  1543. + if(preg_match('/'.$regStr.'/',$datestr,$regs)){
  1544. return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
  1545. }
  1546. return false;
  1547. @@ -852,7 +852,7 @@
  1548. * @access public
  1549. */
  1550. function iso8601_to_timestamp($datestr){
  1551. - $eregStr =
  1552. + $regStr =
  1553. '([0-9]{4})-'. // centuries & years CCYY-
  1554. '([0-9]{2})-'. // months MM-
  1555. '([0-9]{2})'. // days DD
  1556. @@ -861,7 +861,7 @@
  1557. '([0-9]{2}):'. // minutes mm:
  1558. '([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss...
  1559. '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
  1560. - if(ereg($eregStr,$datestr,$regs)){
  1561. + if(preg_match('/'.$regStr.'/',$datestr,$regs)){
  1562. // not utc
  1563. if($regs[8] != 'Z'){
  1564. $op = substr($regs[8],0,1);
  1565. @@ -1171,7 +1171,7 @@
  1566. if(count($attrs) > 0){
  1567. foreach($attrs as $k => $v){
  1568. // if ns declarations, add to class level array of valid namespaces
  1569. - if(ereg("^xmlns",$k)){
  1570. + if(preg_match("/^xmlns/",$k)){
  1571. //$this->xdebug("$k: $v");
  1572. //$this->xdebug('ns_prefix: '.$this->getPrefix($k));
  1573. if($ns_prefix = substr(strrchr($k,':'),1)){
  1574. @@ -1281,7 +1281,7 @@
  1575. // minOccurs="0" maxOccurs="unbounded" />
  1576. // </sequence>
  1577. // </complexType>
  1578. - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
  1579. + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
  1580. $this->xdebug('complexType is unusual array');
  1581. $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
  1582. } else {
  1583. @@ -1300,7 +1300,7 @@
  1584. // minOccurs="0" maxOccurs="unbounded" />
  1585. // </sequence>
  1586. // </complexType>
  1587. - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
  1588. + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
  1589. $this->xdebug('complexType is unusual array');
  1590. $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
  1591. } else {
  1592. @@ -1698,7 +1698,7 @@
  1593. } elseif(isset($this->attributes[$type])){
  1594. $this->xdebug("in getTypeDef, found attribute $type");
  1595. return $this->attributes[$type];
  1596. - } elseif (ereg('_ContainedType$', $type)) {
  1597. + } elseif (preg_match('/_ContainedType$/', $type)) {
  1598. $this->xdebug("in getTypeDef, have an untyped element $type");
  1599. $typeDef['typeClass'] = 'simpleType';
  1600. $typeDef['phpType'] = 'scalar';
  1601. @@ -2041,7 +2041,7 @@
  1602. function soap_transport_http($url){
  1603. parent::nusoap_base();
  1604. $this->setURL($url);
  1605. - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
  1606. + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
  1607. $this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
  1608. $this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']);
  1609. }
  1610. @@ -2580,7 +2580,7 @@
  1611. }
  1612. }
  1613. // remove 100 header
  1614. - if(isset($lb) && ereg('^HTTP/1.1 100',$data)){
  1615. + if(isset($lb) && preg_match('/^HTTP\/1\.1 100/',$data)){
  1616. unset($lb);
  1617. $data = '';
  1618. }//
  1619. @@ -2733,7 +2733,7 @@
  1620. curl_close($this->ch);
  1621.  
  1622. // remove 100 header(s)
  1623. - while (ereg('^HTTP/1.1 100',$data)) {
  1624. + while (preg_match('/^HTTP\/1\.1 100/',$data)) {
  1625. if ($pos = strpos($data,"\r\n\r\n")) {
  1626. $data = ltrim(substr($data,$pos));
  1627. } elseif($pos = strpos($data,"\n\n") ) {
  1628. @@ -2924,7 +2924,7 @@
  1629. */
  1630. function parseCookie($cookie_str) {
  1631. $cookie_str = str_replace('; ', ';', $cookie_str) . ';';
  1632. - $data = split(';', $cookie_str);
  1633. + $data = explode(';', $cookie_str);
  1634. $value_str = $data[0];
  1635.  
  1636. $cookie_param = 'domain=';
  1637. @@ -3267,7 +3267,7 @@
  1638. }
  1639. $this->debug("In service, query string=$qs");
  1640.  
  1641. - if (ereg('wsdl', $qs) ){
  1642. + if (preg_match('/wsdl/', $qs) ){
  1643. $this->debug("In service, this is a request for WSDL");
  1644. if($this->externalWSDLURL){
  1645. if (strpos($this->externalWSDLURL,"://")!==false) { // assume URL
  1646. @@ -3338,7 +3338,7 @@
  1647. // get the character encoding of the incoming request
  1648. if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
  1649. $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1));
  1650. - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
  1651. + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
  1652. $this->xml_encoding = strtoupper($enc);
  1653. } else {
  1654. $this->xml_encoding = 'US-ASCII';
  1655. @@ -3367,7 +3367,7 @@
  1656. $enc = substr(strstr($v, '='), 1);
  1657. $enc = str_replace('"', '', $enc);
  1658. $enc = str_replace('\\', '', $enc);
  1659. - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
  1660. + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
  1661. $this->xml_encoding = strtoupper($enc);
  1662. } else {
  1663. $this->xml_encoding = 'US-ASCII';
  1664. @@ -3401,7 +3401,7 @@
  1665. $enc = substr(strstr($v, '='), 1);
  1666. $enc = str_replace('"', '', $enc);
  1667. $enc = str_replace('\\', '', $enc);
  1668. - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
  1669. + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
  1670. $this->xml_encoding = strtoupper($enc);
  1671. } else {
  1672. $this->xml_encoding = 'US-ASCII';
  1673. @@ -3730,7 +3730,7 @@
  1674. $payload .= $this->getDebugAsXMLComment();
  1675. }
  1676. $this->outgoing_headers[] = "Server: $this->title Server v$this->version";
  1677. - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
  1678. + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
  1679. $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
  1680. // Let the Web server decide about this
  1681. //$this->outgoing_headers[] = "Connection: Close\r\n";
  1682. @@ -3818,7 +3818,7 @@
  1683. if (strpos($headers['content-type'], '=')) {
  1684. $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
  1685. $this->debug('Got response encoding: ' . $enc);
  1686. - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
  1687. + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
  1688. $this->xml_encoding = strtoupper($enc);
  1689. } else {
  1690. $this->xml_encoding = 'US-ASCII';
  1691. @@ -4336,7 +4336,7 @@
  1692. $this->currentSchema->schemaStartElement($parser, $name, $attrs);
  1693. $this->appendDebug($this->currentSchema->getDebug());
  1694. $this->currentSchema->clearDebug();
  1695. - } elseif (ereg('schema$', $name)) {
  1696. + } elseif (preg_match('/schema$/', $name)) {
  1697. $this->debug('Parsing WSDL schema');
  1698. // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
  1699. $this->status = 'schema';
  1700. @@ -4355,7 +4355,7 @@
  1701. if (count($attrs) > 0) {
  1702. // register namespace declarations
  1703. foreach($attrs as $k => $v) {
  1704. - if (ereg("^xmlns", $k)) {
  1705. + if (preg_match("/^xmlns/", $k)) {
  1706. if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
  1707. $this->namespaces[$ns_prefix] = $v;
  1708. } else {
  1709. @@ -4380,7 +4380,7 @@
  1710. $attrs = array();
  1711. }
  1712. // get element prefix, namespace and name
  1713. - if (ereg(':', $name)) {
  1714. + if (preg_match('/:/', $name)) {
  1715. // get ns prefix
  1716. $prefix = substr($name, 0, strpos($name, ':'));
  1717. // get ns
  1718. @@ -4545,7 +4545,7 @@
  1719. */
  1720. function end_element($parser, $name){
  1721. // unset schema status
  1722. - if (/*ereg('types$', $name) ||*/ ereg('schema$', $name)) {
  1723. + if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
  1724. $this->status = "";
  1725. $this->appendDebug($this->currentSchema->getDebug());
  1726. $this->currentSchema->clearDebug();
  1727. @@ -5995,7 +5995,7 @@
  1728. $key_localpart = $this->getLocalPart($key);
  1729. // if ns declarations, add to class level array of valid namespaces
  1730. if($key_prefix == 'xmlns'){
  1731. - if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
  1732. + if(preg_match('/^http:\/\/www\.w3\.org\/[0-9]{4}\/XMLSchema$/',$value)){
  1733. $this->XMLSchemaVersion = $value;
  1734. $this->namespaces['xsd'] = $this->XMLSchemaVersion;
  1735. $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
  1736. @@ -6023,7 +6023,7 @@
  1737. }
  1738. } elseif($key_localpart == 'arrayType'){
  1739. $this->message[$pos]['type'] = 'array';
  1740. - /* do arrayType ereg here
  1741. + /* do arrayType regex here
  1742. [1] arrayTypeValue ::= atype asize
  1743. [2] atype ::= QName rank*
  1744. [3] rank ::= '[' (',')* ']'
  1745. @@ -6031,8 +6031,8 @@
  1746. [5] length ::= nextDimension* Digit+
  1747. [6] nextDimension ::= Digit+ ','
  1748. */
  1749. - $expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
  1750. - if(ereg($expr,$value,$regs)){
  1751. + $expr = '/([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]/';
  1752. + if(preg_match($expr,$value,$regs)){
  1753. $this->message[$pos]['typePrefix'] = $regs[1];
  1754. $this->message[$pos]['arrayTypePrefix'] = $regs[1];
  1755. if (isset($this->namespaces[$regs[1]])) {
  1756. @@ -6510,7 +6510,7 @@
  1757.  
  1758. // instantiate wsdl object and parse wsdl file
  1759. $this->debug('instantiating wsdl class with doc: '.$endpoint);
  1760. - $this->wsdl =& new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout);
  1761. + $this->wsdl = new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout);
  1762. }
  1763. $this->appendDebug($this->wsdl->getDebug());
  1764. $this->wsdl->clearDebug();
  1765. @@ -6758,7 +6758,7 @@
  1766. // detect transport
  1767. switch(true){
  1768. // http(s)
  1769. - case ereg('^http',$this->endpoint):
  1770. + case preg_match('/^http/',$this->endpoint):
  1771. $this->debug('transporting via HTTP');
  1772. if($this->persistentConnection == true && is_object($this->persistentConnection)){
  1773. $http =& $this->persistentConnection;
  1774. @@ -6780,10 +6780,10 @@
  1775. $http->setEncoding($this->http_encoding);
  1776. }
  1777. $this->debug('sending message, length='.strlen($msg));
  1778. - if(ereg('^http:',$this->endpoint)){
  1779. + if(preg_match('/^http:/',$this->endpoint)){
  1780. //if(strpos($this->endpoint,'http:')){
  1781. $this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies);
  1782. - } elseif(ereg('^https',$this->endpoint)){
  1783. + } elseif(preg_match('/^https/',$this->endpoint)){
  1784. //} elseif(strpos($this->endpoint,'https:')){
  1785. //if(phpversion() == '4.3.0-dev'){
  1786. //$response = $http->send($msg,$timeout,$response_timeout);
  1787. @@ -6841,7 +6841,7 @@
  1788. if (strpos($headers['content-type'], '=')) {
  1789. $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
  1790. $this->debug('Got response encoding: ' . $enc);
  1791. - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
  1792. + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
  1793. $this->xml_encoding = strtoupper($enc);
  1794. } else {
  1795. $this->xml_encoding = 'US-ASCII';
  1796. diff -Naur xtcommerce.orig/includes/modules/default.php xtcommerce/includes/modules/default.php
  1797. --- xtcommerce.orig/includes/modules/default.php 2008-02-24 14:02:27.000000000 +0100
  1798. +++ xtcommerce/includes/modules/default.php 2010-08-11 15:40:27.000000000 +0200
  1799. @@ -57,7 +57,7 @@
  1800.  
  1801. $category = xtc_db_fetch_array($category_query, true);
  1802.  
  1803. - if (isset ($cPath) && ereg('_', $cPath)) {
  1804. + if (isset ($cPath) && preg_match('/_/', $cPath)) {
  1805. // check to see if there are deeper categories within the current category
  1806. $category_links = array_reverse($cPath_array);
  1807. for ($i = 0, $n = sizeof($category_links); $i < $n; $i ++) {
  1808. @@ -417,4 +417,4 @@
  1809. $smarty->assign('main_content', $main_content);
  1810. }
  1811. }
  1812. -?>
  1813. \ No newline at end of file
  1814. +?>
  1815. diff -Naur xtcommerce.orig/includes/modules/order_total/ot_cod_fee.php xtcommerce/includes/modules/order_total/ot_cod_fee.php
  1816. --- xtcommerce.orig/includes/modules/order_total/ot_cod_fee.php 2005-07-10 18:11:38.000000000 +0200
  1817. +++ xtcommerce/includes/modules/order_total/ot_cod_fee.php 2010-08-11 15:23:49.000000000 +0200
  1818. @@ -55,34 +55,34 @@
  1819. //check if payment method is cod. If yes, check if cod is possible.
  1820. if ($_SESSION['payment'] == 'cod') {
  1821. //process installed shipping modules
  1822. - if ($_SESSION['shipping']['id'] == 'flat_flat') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FLAT);
  1823. - if ($_SESSION['shipping']['id'] == 'item_item') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_ITEM);
  1824. - if ($_SESSION['shipping']['id'] == 'table_table') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_TABLE);
  1825. - if ($_SESSION['shipping']['id'] == 'zones_zones') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_ZONES);
  1826. - if ($_SESSION['shipping']['id'] == 'ap_ap') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_AP);
  1827. - if ($_SESSION['shipping']['id'] == 'dp_dp') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DP);
  1828. + if ($_SESSION['shipping']['id'] == 'flat_flat') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_FLAT);
  1829. + if ($_SESSION['shipping']['id'] == 'item_item') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_ITEM);
  1830. + if ($_SESSION['shipping']['id'] == 'table_table') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_TABLE);
  1831. + if ($_SESSION['shipping']['id'] == 'zones_zones') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_ZONES);
  1832. + if ($_SESSION['shipping']['id'] == 'ap_ap') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_AP);
  1833. + if ($_SESSION['shipping']['id'] == 'dp_dp') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DP);
  1834.  
  1835. // module chp
  1836. - if ($_SESSION['shipping']['id'] == 'chp_ECO') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  1837. - if ($_SESSION['shipping']['id'] == 'chp_PRI') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  1838. - if ($_SESSION['shipping']['id'] == 'chp_URG') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  1839. + if ($_SESSION['shipping']['id'] == 'chp_ECO') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  1840. + if ($_SESSION['shipping']['id'] == 'chp_PRI') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  1841. + if ($_SESSION['shipping']['id'] == 'chp_URG') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  1842.  
  1843. // module chronopost
  1844. - if ($_SESSION['shipping']['id'] == 'chronopost_chronopost') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST);
  1845. + if ($_SESSION['shipping']['id'] == 'chronopost_chronopost') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST);
  1846.  
  1847. // module DHL
  1848. - if ($_SESSION['shipping']['id'] == 'dhl_ECX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1849. - if ($_SESSION['shipping']['id'] == 'dhl_DOX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1850. - if ($_SESSION['shipping']['id'] == 'dhl_SDX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1851. - if ($_SESSION['shipping']['id'] == 'dhl_MDX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1852. - if ($_SESSION['shipping']['id'] == 'dhl_WPX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1853. + if ($_SESSION['shipping']['id'] == 'dhl_ECX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1854. + if ($_SESSION['shipping']['id'] == 'dhl_DOX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1855. + if ($_SESSION['shipping']['id'] == 'dhl_SDX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1856. + if ($_SESSION['shipping']['id'] == 'dhl_MDX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1857. + if ($_SESSION['shipping']['id'] == 'dhl_WPX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  1858. // UPS
  1859. - if ($_SESSION['shipping']['id'] == 'ups_ups') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_UPS);
  1860. - if ($_SESSION['shipping']['id'] == 'upse_upse') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_UPSE);
  1861. + if ($_SESSION['shipping']['id'] == 'ups_ups') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_UPS);
  1862. + if ($_SESSION['shipping']['id'] == 'upse_upse') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_UPSE);
  1863.  
  1864. // Free Shipping
  1865. - if ($_SESSION['shipping']['id'] == 'free_free') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FREE);
  1866. - if ($_SESSION['shipping']['id'] == 'freeamount_freeamount') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_FREEAMOUNT_FREE);
  1867. + if ($_SESSION['shipping']['id'] == 'free_free') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_FREE);
  1868. + if ($_SESSION['shipping']['id'] == 'freeamount_freeamount') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_FREEAMOUNT_FREE);
  1869.  
  1870.  
  1871. for ($i = 0; $i < count($cod_zones); $i++) {
  1872. @@ -189,4 +189,4 @@
  1873. xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
  1874. }
  1875. }
  1876. -?>
  1877. \ No newline at end of file
  1878. +?>
  1879. diff -Naur xtcommerce.orig/includes/modules/order_total/ot_coupon.php xtcommerce/includes/modules/order_total/ot_coupon.php
  1880. --- xtcommerce.orig/includes/modules/order_total/ot_coupon.php 2006-06-03 16:41:52.000000000 +0200
  1881. +++ xtcommerce/includes/modules/order_total/ot_coupon.php 2010-08-11 15:37:55.000000000 +0200
  1882. @@ -174,7 +174,7 @@
  1883.  
  1884. for ($i = 0; $i < sizeof($order->products); $i ++) {
  1885. if ($get_result['restrict_to_products']) {
  1886. - $pr_ids = split("[,]", $get_result['restrict_to_products']);
  1887. + $pr_ids = explode(",", $get_result['restrict_to_products']);
  1888. for ($ii = 0; $p < count($pr_ids); $ii ++) {
  1889. if ($pr_ids[$ii] == xtc_get_prid($order->products[$i]['id'])) {
  1890. if ($get_result['coupon_type'] == 'P') {
  1891. @@ -190,10 +190,10 @@
  1892. }
  1893. }
  1894. } else {
  1895. - $cat_ids = split("[,]", $get_result['restrict_to_categories']);
  1896. + $cat_ids = explode(",", $get_result['restrict_to_categories']);
  1897. for ($i = 0; $i < sizeof($order->products); $i ++) {
  1898. $my_path = xtc_get_product_path(xtc_get_prid($order->products[$i]['id']));
  1899. - $sub_cat_ids = split("[_]", $my_path);
  1900. + $sub_cat_ids = explode("_", $my_path);
  1901. for ($iii = 0; $iii < count($sub_cat_ids); $iii ++) {
  1902. for ($ii = 0; $ii < count($cat_ids); $ii ++) {
  1903. if ($sub_cat_ids[$iii] == $cat_ids[$ii]) {
  1904. @@ -262,7 +262,7 @@
  1905.  
  1906.  
  1907. if ($get_result['restrict_to_products']) {
  1908. - $pr_ids = split("[,]", $get_result['restrict_to_products']);
  1909. + $pr_ids = explode(",", $get_result['restrict_to_products']);
  1910. for ($p = 0; $p < sizeof($pr_ids); $p ++) {
  1911. if ($pr_ids[$p] == $t_prid)
  1912. $valid_product = true;
  1913. @@ -271,9 +271,9 @@
  1914.  
  1915. if ($get_result['restrict_to_categories']) {
  1916. // v5.13a Tanaka 2005-4-30: New code, this correctly identifies valid products in subcategories
  1917. - $cat_ids = split("[,]", $get_result['restrict_to_categories']);
  1918. + $cat_ids = explode(",", $get_result['restrict_to_categories']);
  1919. $my_path = xtc_get_product_path($t_prid);
  1920. - $sub_cat_ids = split("[_]", $my_path);
  1921. + $sub_cat_ids = explode("_", $my_path);
  1922. for ($iii = 0; $iii < count($sub_cat_ids); $iii++) {
  1923. for ($ii = 0; $ii < count($cat_ids); $ii++) {
  1924. if ($sub_cat_ids[$iii] == $cat_ids[$ii]) {
  1925. @@ -401,7 +401,7 @@
  1926. $t_prid = xtc_get_prid($products[$i]['id']);
  1927. $gv_query = xtc_db_query("select products_price, products_tax_class_id, products_model from ".TABLE_PRODUCTS." where products_id = '".$t_prid."'");
  1928. $gv_result = xtc_db_fetch_array($gv_query);
  1929. - if (ereg('^GIFT', addslashes($gv_result['products_model']))) {
  1930. + if (preg_match('/^GIFT/', addslashes($gv_result['products_model']))) {
  1931. $qty = $_SESSION['cart']->get_quantity($t_prid);
  1932. $products_tax = $xtPrice->TAX[$gv_result['products_tax_class_id']];
  1933. if ($this->include_tax == 'false') {
  1934. @@ -426,7 +426,7 @@
  1935. $get_result = xtc_db_fetch_array($coupon_get);
  1936. $in_cat = true;
  1937. if ($get_result['restrict_to_categories']) {
  1938. - $cat_ids = split("[,]", $get_result['restrict_to_categories']);
  1939. + $cat_ids = explode(",", $get_result['restrict_to_categories']);
  1940. $in_cat = false;
  1941. for ($i = 0; $i < count($cat_ids); $i ++) {
  1942. if (is_array($this->contents)) {
  1943. @@ -444,7 +444,7 @@
  1944. $in_cart = true;
  1945. if ($get_result['restrict_to_products']) {
  1946.  
  1947. - $pr_ids = split("[,]", $get_result['restrict_to_products']);
  1948. + $pr_ids = explode(",", $get_result['restrict_to_products']);
  1949.  
  1950. $in_cart = false;
  1951. $products_array = $_SESSION['cart']->get_products();
  1952. diff -Naur xtcommerce.orig/includes/modules/order_total/ot_gv.php xtcommerce/includes/modules/order_total/ot_gv.php
  1953. --- xtcommerce.orig/includes/modules/order_total/ot_gv.php 2005-08-26 17:16:32.000000000 +0200
  1954. +++ xtcommerce/includes/modules/order_total/ot_gv.php 2010-08-11 15:37:23.000000000 +0200
  1955. @@ -132,7 +132,7 @@
  1956.  
  1957. function update_credit_account($i) {
  1958. global $order, $insert_id, $REMOTE_ADDR;
  1959. - if (ereg('^GIFT', addslashes($order->products[$i]['model']))) {
  1960. + if (preg_match('/^GIFT/', addslashes($order->products[$i]['model']))) {
  1961. $gv_order_amount = ($order->products[$i]['final_price']);
  1962. if ($this->credit_tax == 'true')
  1963. $gv_order_amount = $gv_order_amount * (100 + $order->products[$i]['tax']) / 100;
  1964. @@ -340,4 +340,4 @@
  1965. xtc_db_query("delete from ".TABLE_CONFIGURATION." where configuration_key in ('".implode("', '", $this->keys())."')");
  1966. }
  1967. }
  1968. -?>
  1969. \ No newline at end of file
  1970. +?>
  1971. diff -Naur xtcommerce.orig/includes/modules/order_total/ot_ps_fee.php xtcommerce/includes/modules/order_total/ot_ps_fee.php
  1972. --- xtcommerce.orig/includes/modules/order_total/ot_ps_fee.php 2005-07-10 18:11:38.000000000 +0200
  1973. +++ xtcommerce/includes/modules/order_total/ot_ps_fee.php 2010-08-11 15:36:35.000000000 +0200
  1974. @@ -61,12 +61,12 @@
  1975.  
  1976. if ($age > '0') {
  1977. //process installed shipping modules
  1978. - if ($_SESSION['shipping']['id'] == 'flat_flat') $ps_zones = split("[:,]", MODULE_ORDER_TOTAL_PS_FEE_FLAT);
  1979. - if ($_SESSION['shipping']['id'] == 'item_item') $ps_zones = split("[:,]", MODULE_ORDER_TOTAL_PS_FEE_ITEM);
  1980. - if ($_SESSION['shipping']['id'] == 'table_table') $ps_zones = split("[:,]", MODULE_ORDER_TOTAL_PS_FEE_TABLE);
  1981. - if ($_SESSION['shipping']['id'] == 'zones_zones') $ps_zones = split("[:,]", MODULE_ORDER_TOTAL_PS_FEE_ZONES);
  1982. - if ($_SESSION['shipping']['id'] == 'ap_ap') $ps_zones = split("[:,]", MODULE_ORDER_TOTAL_PS_FEE_AP);
  1983. - if ($_SESSION['shipping']['id'] == 'dp_dp') $ps_zones = split("[:,]", MODULE_ORDER_TOTAL_PS_FEE_DP);
  1984. + if ($_SESSION['shipping']['id'] == 'flat_flat') $ps_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_PS_FEE_FLAT);
  1985. + if ($_SESSION['shipping']['id'] == 'item_item') $ps_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_PS_FEE_ITEM);
  1986. + if ($_SESSION['shipping']['id'] == 'table_table') $ps_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_PS_FEE_TABLE);
  1987. + if ($_SESSION['shipping']['id'] == 'zones_zones') $ps_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_PS_FEE_ZONES);
  1988. + if ($_SESSION['shipping']['id'] == 'ap_ap') $ps_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_PS_FEE_AP);
  1989. + if ($_SESSION['shipping']['id'] == 'dp_dp') $ps_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_PS_FEE_DP);
  1990.  
  1991. for ($i = 0; $i < count($ps_zones); $i++) {
  1992. if ($ps_zones[$i] == $order->billing['country']['iso_code_2']) {
  1993. @@ -161,4 +161,4 @@
  1994. xtc_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
  1995. }
  1996. }
  1997. -?>
  1998. \ No newline at end of file
  1999. +?>
  2000. diff -Naur xtcommerce.orig/includes/modules/payment/cod.php xtcommerce/includes/modules/payment/cod.php
  2001. --- xtcommerce.orig/includes/modules/payment/cod.php 2005-07-10 20:58:52.000000000 +0200
  2002. +++ xtcommerce/includes/modules/payment/cod.php 2010-08-11 15:23:15.000000000 +0200
  2003. @@ -78,34 +78,34 @@
  2004. $cod_country = false;
  2005.  
  2006. //process installed shipping modules
  2007. - if ($_SESSION['shipping']['id'] == 'flat_flat') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FLAT);
  2008. - if ($_SESSION['shipping']['id'] == 'item_item') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_ITEM);
  2009. - if ($_SESSION['shipping']['id'] == 'table_table') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_TABLE);
  2010. - if ($_SESSION['shipping']['id'] == 'zones_zones') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_ZONES);
  2011. - if ($_SESSION['shipping']['id'] == 'ap_ap') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_AP);
  2012. - if ($_SESSION['shipping']['id'] == 'dp_dp') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DP);
  2013. + if ($_SESSION['shipping']['id'] == 'flat_flat') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_FLAT);
  2014. + if ($_SESSION['shipping']['id'] == 'item_item') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_ITEM);
  2015. + if ($_SESSION['shipping']['id'] == 'table_table') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_TABLE);
  2016. + if ($_SESSION['shipping']['id'] == 'zones_zones') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_ZONES);
  2017. + if ($_SESSION['shipping']['id'] == 'ap_ap') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_AP);
  2018. + if ($_SESSION['shipping']['id'] == 'dp_dp') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DP);
  2019.  
  2020.  
  2021. - if ($_SESSION['shipping']['id'] == 'chp_ECO') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  2022. - if ($_SESSION['shipping']['id'] == 'chp_PRI') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  2023. - if ($_SESSION['shipping']['id'] == 'chp_URG') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  2024. + if ($_SESSION['shipping']['id'] == 'chp_ECO') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  2025. + if ($_SESSION['shipping']['id'] == 'chp_PRI') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  2026. + if ($_SESSION['shipping']['id'] == 'chp_URG') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHP);
  2027.  
  2028.  
  2029. - if ($_SESSION['shipping']['id'] == 'chronopost_chronopost') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST);
  2030. + if ($_SESSION['shipping']['id'] == 'chronopost_chronopost') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_CHRONOPOST);
  2031.  
  2032.  
  2033. - if ($_SESSION['shipping']['id'] == 'dhl_ECX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2034. - if ($_SESSION['shipping']['id'] == 'dhl_DOX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2035. - if ($_SESSION['shipping']['id'] == 'dhl_SDX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2036. - if ($_SESSION['shipping']['id'] == 'dhl_MDX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2037. - if ($_SESSION['shipping']['id'] == 'dhl_WPX') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2038. + if ($_SESSION['shipping']['id'] == 'dhl_ECX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2039. + if ($_SESSION['shipping']['id'] == 'dhl_DOX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2040. + if ($_SESSION['shipping']['id'] == 'dhl_SDX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2041. + if ($_SESSION['shipping']['id'] == 'dhl_MDX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2042. + if ($_SESSION['shipping']['id'] == 'dhl_WPX') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_DHL);
  2043.  
  2044. - if ($_SESSION['shipping']['id'] == 'ups_ups') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_UPS);
  2045. - if ($_SESSION['shipping']['id'] == 'upse_upse') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_UPSE);
  2046. + if ($_SESSION['shipping']['id'] == 'ups_ups') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_UPS);
  2047. + if ($_SESSION['shipping']['id'] == 'upse_upse') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_UPSE);
  2048.  
  2049.  
  2050. - if ($_SESSION['shipping']['id'] == 'free_free') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_COD_FEE_FREE);
  2051. - if ($_SESSION['shipping']['id'] == 'freeamount_freeamount') $cod_zones = split("[:,]", MODULE_ORDER_TOTAL_FREEAMOUNT_FREE);
  2052. + if ($_SESSION['shipping']['id'] == 'free_free') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_COD_FEE_FREE);
  2053. + if ($_SESSION['shipping']['id'] == 'freeamount_freeamount') $cod_zones = preg_split("/[:,]/", MODULE_ORDER_TOTAL_FREEAMOUNT_FREE);
  2054.  
  2055.  
  2056. for ($i = 0; $i < count($cod_zones); $i++) {
  2057. @@ -202,4 +202,4 @@
  2058. return array ('MODULE_PAYMENT_COD_STATUS', 'MODULE_PAYMENT_COD_ALLOWED', 'MODULE_PAYMENT_COD_ZONE', 'MODULE_PAYMENT_COD_ORDER_STATUS_ID', 'MODULE_PAYMENT_COD_SORT_ORDER');
  2059. }
  2060. }
  2061. -?>
  2062. \ No newline at end of file
  2063. +?>
  2064. diff -Naur xtcommerce.orig/includes/modules/products_media.php xtcommerce/includes/modules/products_media.php
  2065. --- xtcommerce.orig/includes/modules/products_media.php 2005-09-29 18:11:20.000000000 +0200
  2066. +++ xtcommerce/includes/modules/products_media.php 2010-08-11 15:39:28.000000000 +0200
  2067. @@ -71,7 +71,7 @@
  2068. $filename .= '</a>';
  2069. $button = '';
  2070. if ($content_data['content_link'] == '') {
  2071. - if (eregi('.html', $content_data['content_file']) or eregi('.htm', $content_data['content_file']) or eregi('.txt', $content_data['content_file']) or eregi('.bmp', $content_data['content_file']) or eregi('.jpg', $content_data['content_file']) or eregi('.gif', $content_data['content_file']) or eregi('.png', $content_data['content_file']) or eregi('.tif', $content_data['content_file'])) {
  2072. + if (preg_match('/\.html/i', $content_data['content_file']) or preg_match('/\.htm/i', $content_data['content_file']) or preg_match('/\.txt/i', $content_data['content_file']) or preg_match('/\.bmp/i', $content_data['content_file']) or preg_match('/\.jpg/i', $content_data['content_file']) or preg_match('/\.gif/i', $content_data['content_file']) or preg_match('/\.png/i', $content_data['content_file']) or preg_match('/\.tif/i', $content_data['content_file'])) {
  2073.  
  2074. $button = '<a style="cursor:hand" onClick="javascript:window.open(\''.xtc_href_link(FILENAME_MEDIA_CONTENT, 'coID='.$content_data['content_id']).'\', \'popup\', \'toolbar=0, width=640, height=600\')">'.xtc_image_button('button_view.gif', TEXT_VIEW).'</a>';
  2075.  
  2076. @@ -93,4 +93,4 @@
  2077.  
  2078. $info_smarty->assign('MODULE_products_media', $module);
  2079. }
  2080. -?>
  2081. \ No newline at end of file
  2082. +?>
  2083. diff -Naur xtcommerce.orig/includes/modules/shipping/ap.php xtcommerce/includes/modules/shipping/ap.php
  2084. --- xtcommerce.orig/includes/modules/shipping/ap.php 2005-04-29 04:40:58.000000000 +0200
  2085. +++ xtcommerce/includes/modules/shipping/ap.php 2010-08-11 15:33:39.000000000 +0200
  2086. @@ -75,7 +75,7 @@
  2087.  
  2088. for ($i=1; $i<=$this->num_ap; $i++) {
  2089. $countries_table = constant('MODULE_SHIPPING_AP_COUNTRIES_' . $i);
  2090. - $country_zones = split("[,]", $countries_table);
  2091. + $country_zones = explode(",", $countries_table);
  2092. if (in_array($dest_country, $country_zones)) {
  2093. $dest_zone = $i;
  2094. break;
  2095. @@ -88,7 +88,7 @@
  2096. $shipping = -1;
  2097. $ap_cost = constant('MODULE_SHIPPING_AP_COST_' . $i);
  2098.  
  2099. - $ap_table = split("[:,]" , $ap_cost);
  2100. + $ap_table = preg_split("/[:,]/" , $ap_cost);
  2101. for ($i=0; $i<sizeof($ap_table); $i+=2) {
  2102. if ($shipping_weight <= $ap_table[$i]) {
  2103. $shipping = $ap_table[$i+1];
  2104. diff -Naur xtcommerce.orig/includes/modules/shipping/chp.php xtcommerce/includes/modules/shipping/chp.php
  2105. --- xtcommerce.orig/includes/modules/shipping/chp.php 2005-04-29 04:40:58.000000000 +0200
  2106. +++ xtcommerce/includes/modules/shipping/chp.php 2010-08-11 15:34:39.000000000 +0200
  2107. @@ -80,7 +80,7 @@
  2108.  
  2109. for ($j=1; $j<=$this->num_chp; $j++) {
  2110. $countries_table = constant('MODULE_SHIPPING_CHP_COUNTRIES_' . $j);
  2111. - $country_zones = split("[,]", $countries_table);
  2112. + $country_zones = explode(",", $countries_table);
  2113. if (in_array($dest_country, $country_zones)) {
  2114. $dest_zone = $j;
  2115. break;
  2116. @@ -98,7 +98,7 @@
  2117. $methods = array();
  2118.  
  2119. if ($chp_cost_eco != '') {
  2120. - $chp_table_eco = split("[:,]" , $chp_cost_eco);
  2121. + $chp_table_eco = preg_split("/[:,]/" , $chp_cost_eco);
  2122.  
  2123. for ($i=0; $i<sizeof($chp_table_eco); $i+=2) {
  2124. if ($shipping_weight <= $chp_table_eco[$i]) {
  2125. @@ -122,7 +122,7 @@
  2126. }
  2127.  
  2128. if ($chp_cost_pri != '') {
  2129. - $chp_table_pri = split("[:,]" , $chp_cost_pri);
  2130. + $chp_table_pri = preg_split("/[:,]/" , $chp_cost_pri);
  2131.  
  2132. for ($i=0; $i<sizeof($chp_table_pri); $i+=2) {
  2133. if ($shipping_weight <= $chp_table_pri[$i]) {
  2134. @@ -146,7 +146,7 @@
  2135. }
  2136.  
  2137. if ($chp_cost_urg != '') {
  2138. - $chp_table_urg = split("[:,]" , $chp_cost_urg);
  2139. + $chp_table_urg = preg_split("/[:,]/" , $chp_cost_urg);
  2140.  
  2141. for ($i=0; $i<sizeof($chp_table_urg); $i+=2) {
  2142. if ($shipping_weight <= $chp_table_urg[$i]) {
  2143. diff -Naur xtcommerce.orig/includes/modules/shipping/chronopost.php xtcommerce/includes/modules/shipping/chronopost.php
  2144. --- xtcommerce.orig/includes/modules/shipping/chronopost.php 2005-04-29 04:40:58.000000000 +0200
  2145. +++ xtcommerce/includes/modules/shipping/chronopost.php 2010-08-11 15:36:01.000000000 +0200
  2146. @@ -79,7 +79,7 @@
  2147. $dest_zone = 0;
  2148. for ($i = 1; $i <= $this->num_chronopost; $i ++) {
  2149. $countries_table = constant('MODULE_SHIPPING_CHRONOPOST_COUNTRIES_' . $i);
  2150. - $country = split("[,]", $countries_table);
  2151. + $country = explode(",", $countries_table);
  2152. if ( in_array($dest_country, $country ) ) {
  2153. $dest_zone = $i;
  2154. break;
  2155. @@ -90,7 +90,7 @@
  2156. return $this->quotes;
  2157. }
  2158.  
  2159. - $table = split("[:,]" , constant('MODULE_SHIPPING_CHRONOPOST_COST_' . $dest_zone));
  2160. + $table = preg_split("/[:,]/" , constant('MODULE_SHIPPING_CHRONOPOST_COST_' . $dest_zone));
  2161. $cost = -1;
  2162. for ($i = 0, $n = sizeof($table); $i < $n; $i+=2) {
  2163. if ($shipping_weight <= $table[$i]) {
  2164. diff -Naur xtcommerce.orig/includes/modules/shipping/dhl.php xtcommerce/includes/modules/shipping/dhl.php
  2165. --- xtcommerce.orig/includes/modules/shipping/dhl.php 2005-04-29 04:40:58.000000000 +0200
  2166. +++ xtcommerce/includes/modules/shipping/dhl.php 2010-08-11 15:34:17.000000000 +0200
  2167. @@ -83,7 +83,7 @@
  2168.  
  2169. for ($j=1; $j<=$this->num_dhl; $j++) {
  2170. $countries_table = constant('MODULE_SHIPPING_DHL_COUNTRIES_' . $j);
  2171. - $country_zones = split("[,]", $countries_table);
  2172. + $country_zones = explode(",", $countries_table);
  2173. if (in_array($dest_country, $country_zones)) {
  2174. $dest_zone = $j;
  2175. break;
  2176. @@ -104,7 +104,7 @@
  2177. $n == 0;
  2178.  
  2179. if ($dhl_cost_ecx != '') {
  2180. - $dhl_table_ecx = split("[:,]" , $dhl_cost_ecx);
  2181. + $dhl_table_ecx = preg_split("/[:,]/" , $dhl_cost_ecx);
  2182. if ( ($shipping_weight > 10) and ($shipping_weight <= 20) ) {
  2183. $shipping_ecx = number_format((($shipping_weight - 10)* 2 + 0.5), 0) * constant('MODULE_SHIPPING_DHL_STEP_ECX_20_' .$j) + $dhl_table_ecx[count ($dhl_table_ecx)-1];
  2184. } elseif ( ($shipping_weight > 20) and ($shipping_weight <= 30) ) {
  2185. @@ -137,7 +137,7 @@
  2186. }
  2187.  
  2188. if ($dhl_cost_dox != '') {
  2189. - $dhl_table_dox = split("[:,]" , $dhl_cost_dox);
  2190. + $dhl_table_dox = preg_split("/[:,]/" , $dhl_cost_dox);
  2191. if ( ($shipping_weight > 10) and ($shipping_weight <= 20) ) {
  2192. $shipping_dox = number_format((($shipping_weight - 10)* 2 + 0.5), 0) * constant('MODULE_SHIPPING_DHL_STEP_DOX_20_' .$j) + $dhl_table_dox[count ($dhl_table_dox)-1];
  2193. } elseif ( ($shipping_weight > 20) and ($shipping_weight <= 30) ) {
  2194. @@ -170,7 +170,7 @@
  2195. }
  2196.  
  2197. if ($dhl_cost_wpx != '') {
  2198. - $dhl_table_wpx = split("[:,]" , $dhl_cost_wpx);
  2199. + $dhl_table_wpx = preg_split("/[:,]/" , $dhl_cost_wpx);
  2200. if ( ($shipping_weight > 10) and ($shipping_weight <= 20) ) {
  2201. $shipping_wpx = number_format((($shipping_weight - 10)* 2 + 0.5), 0) * constant('MODULE_SHIPPING_DHL_STEP_WPX_20_' .$j) + $dhl_table_wpx[count ($dhl_table_wpx)-1];
  2202. } elseif ( ($shipping_weight > 20) and ($shipping_weight <= 30) ) {
  2203. @@ -203,7 +203,7 @@
  2204. }
  2205.  
  2206. if ($dhl_cost_mdx != '') {
  2207. - $dhl_table_mdx = split("[:,]" , $dhl_cost_mdx);
  2208. + $dhl_table_mdx = preg_split("/[:,]/" , $dhl_cost_mdx);
  2209. if ( ($shipping_weight > 10) and ($shipping_weight <= 20) ) {
  2210. $shipping_mdx = number_format((($shipping_weight - 10)* 2 + 0.5), 0) * constant('MODULE_SHIPPING_DHL_STEP_MDX_20_' .$j) + $dhl_table_mdx[count ($dhl_table_mdx)-1];
  2211. } elseif ( ($shipping_weight > 20) and ($shipping_weight <= 30) ) {
  2212. @@ -236,7 +236,7 @@
  2213. }
  2214.  
  2215. if ($dhl_cost_sdx != '') {
  2216. - $dhl_table_sdx = split("[:,]" , $dhl_cost_sdx);
  2217. + $dhl_table_sdx = preg_split("/[:,]/" , $dhl_cost_sdx);
  2218. if ( ($shipping_weight > 10) and ($shipping_weight <= 20) ) {
  2219. $shipping_sdx = number_format((($shipping_weight - 10)* 2 + 0.5), 0) * constant('MODULE_SHIPPING_DHL_STEP_SDX_20_' .$j) + $dhl_table_sdx[count ($dhl_table_sdx)-1];
  2220. } elseif ( ($shipping_weight > 20) and ($shipping_weight <= 30) ) {
  2221. diff -Naur xtcommerce.orig/includes/modules/shipping/dp.php xtcommerce/includes/modules/shipping/dp.php
  2222. --- xtcommerce.orig/includes/modules/shipping/dp.php 2005-04-29 04:40:58.000000000 +0200
  2223. +++ xtcommerce/includes/modules/shipping/dp.php 2010-08-11 15:33:03.000000000 +0200
  2224. @@ -74,7 +74,7 @@
  2225.  
  2226. for ($i=1; $i<=$this->num_dp; $i++) {
  2227. $countries_table = constant('MODULE_SHIPPING_DP_COUNTRIES_' . $i);
  2228. - $country_zones = split("[,]", $countries_table);
  2229. + $country_zones = explode(",", $countries_table);
  2230. if (in_array($dest_country, $country_zones)) {
  2231. $dest_zone = $i;
  2232. break;
  2233. @@ -87,7 +87,7 @@
  2234. $shipping = -1;
  2235. $dp_cost = constant('MODULE_SHIPPING_DP_COST_' . $i);
  2236.  
  2237. - $dp_table = split("[:,]" , $dp_cost);
  2238. + $dp_table = preg_split("/[:,]/" , $dp_cost);
  2239. for ($i=0; $i<sizeof($dp_table); $i+=2) {
  2240. if ($shipping_weight <= $dp_table[$i]) {
  2241. $shipping = $dp_table[$i+1];
  2242. diff -Naur xtcommerce.orig/includes/modules/shipping/fedexeu.php xtcommerce/includes/modules/shipping/fedexeu.php
  2243. --- xtcommerce.orig/includes/modules/shipping/fedexeu.php 2005-04-29 04:40:58.000000000 +0200
  2244. +++ xtcommerce/includes/modules/shipping/fedexeu.php 2010-08-11 15:35:05.000000000 +0200
  2245. @@ -76,7 +76,7 @@
  2246.  
  2247. for ($j=1; $j<=$this->num_fedexeu; $j++) {
  2248. $countries_table = constant('MODULE_SHIPPING_FEDEXEU_COUNTRIES_' . $j);
  2249. - $country_zones = split("[,]", $countries_table);
  2250. + $country_zones = explode(",", $countries_table);
  2251. if (in_array($dest_country, $country_zones)) {
  2252. $dest_zone = $j;
  2253. break;
  2254. @@ -94,7 +94,7 @@
  2255. $methods = array();
  2256.  
  2257. if ($fedexeu_cost_pak != '') {
  2258. - $fedexeu_table_pak = split("[:,]" , $fedexeu_cost_pak);
  2259. + $fedexeu_table_pak = preg_split("/[:,]/" , $fedexeu_cost_pak);
  2260.  
  2261. for ($i=0; $i<sizeof($fedexeu_table_pak); $i+=2) {
  2262. if ($shipping_weight <= $fedexeu_table_pak[$i]) {
  2263. @@ -119,7 +119,7 @@
  2264.  
  2265.  
  2266. if ($fedexeu_cost_env != '') {
  2267. - $fedexeu_table_env = split("[:,]" , $fedexeu_cost_env);
  2268. + $fedexeu_table_env = preg_split("/[:,]/" , $fedexeu_cost_env);
  2269.  
  2270. for ($i=0; $i<sizeof($fedexeu_table_env); $i+=2) {
  2271. if ($shipping_weight <= $fedexeu_table_env[$i]) {
  2272. @@ -144,7 +144,7 @@
  2273.  
  2274.  
  2275. if ($fedexeu_cost_box != '') {
  2276. - $fedexeu_table_box = split("[:,]" , $fedexeu_cost_box);
  2277. + $fedexeu_table_box = preg_split("/[:,]/" , $fedexeu_cost_box);
  2278. if ( ($shipping_weight > 10) and ($shipping_weight <= 20) ) {
  2279. $shipping_box = number_format((($shipping_weight - 10)* 2 + 0.5), 0) * constant('MODULE_SHIPPING_FEDEXEU_STEP_BOX_20_' .$j) + $fedexeu_table_box[count ($fedexeu_table_box)-1];
  2280. } elseif ( ($shipping_weight > 20) and ($shipping_weight <= 40) ) {
  2281. diff -Naur xtcommerce.orig/includes/modules/shipping/table.php xtcommerce/includes/modules/shipping/table.php
  2282. --- xtcommerce.orig/includes/modules/shipping/table.php 2005-07-10 18:11:38.000000000 +0200
  2283. +++ xtcommerce/includes/modules/shipping/table.php 2010-08-11 14:24:04.000000000 +0200
  2284. @@ -61,7 +61,7 @@
  2285. $order_total = $shipping_weight;
  2286. }
  2287.  
  2288. - $table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST);
  2289. + $table_cost = preg_split("/[:,]/" , MODULE_SHIPPING_TABLE_COST);
  2290. $size = sizeof($table_cost);
  2291. for ($i=0, $n=$size; $i<$n; $i+=2) {
  2292. if ($order_total <= $table_cost[$i]) {
  2293. diff -Naur xtcommerce.orig/includes/modules/shipping/upse.php xtcommerce/includes/modules/shipping/upse.php
  2294. --- xtcommerce.orig/includes/modules/shipping/upse.php 2005-05-09 23:57:00.000000000 +0200
  2295. +++ xtcommerce/includes/modules/shipping/upse.php 2010-08-11 15:35:50.000000000 +0200
  2296. @@ -75,7 +75,7 @@
  2297.  
  2298. for ($i=1; $i<=$this->num_upse; $i++) {
  2299. $countries_table = constant('MODULE_SHIPPING_UPSE_COUNTRIES_' . $i);
  2300. - $country_zones = split("[,]", $countries_table);
  2301. + $country_zones = explode(",", $countries_table);
  2302. if (in_array($dest_country, $country_zones)) {
  2303. $dest_zone = $i;
  2304. break;
  2305. @@ -88,7 +88,7 @@
  2306. $shipping = -1;
  2307. $upse_cost = constant('MODULE_SHIPPING_UPSE_COST_' . $i);
  2308.  
  2309. - $upse_table = split("[:,]" , $upse_cost);
  2310. + $upse_table = preg_split("/[:,]/" , $upse_cost);
  2311. for ($i=0; $i<sizeof($upse_table); $i+=2) {
  2312. if ($shipping_weight <= $upse_table[$i]) {
  2313. $shipping = $upse_table[$i+1];
  2314. diff -Naur xtcommerce.orig/includes/modules/shipping/ups.php xtcommerce/includes/modules/shipping/ups.php
  2315. --- xtcommerce.orig/includes/modules/shipping/ups.php 2005-05-09 23:57:00.000000000 +0200
  2316. +++ xtcommerce/includes/modules/shipping/ups.php 2010-08-11 15:33:27.000000000 +0200
  2317. @@ -80,7 +80,7 @@
  2318.  
  2319. for ($i=1; $i<=$this->num_ups; $i++) {
  2320. $countries_table = constant('MODULE_SHIPPING_UPS_COUNTRIES_' . $i);
  2321. - $country_zones = split("[,]", $countries_table);
  2322. + $country_zones = explode(",", $countries_table);
  2323. if (in_array($dest_country, $country_zones)) {
  2324. $dest_zone = $i;
  2325. break;
  2326. @@ -97,7 +97,7 @@
  2327. $lowship = true;
  2328. $shipping = -1;
  2329. $ups_cost = constant('MODULE_SHIPPING_UPS_COST_' . $i);
  2330. - $ups_table = split("[:,]" , $ups_cost);
  2331. + $ups_table = preg_split("/[:,]/" , $ups_cost);
  2332. for ($i=0; $i<sizeof($ups_table); $i+=2) {
  2333. if ($shipping_weight <= $ups_table[$i]) {
  2334. $shipping = $ups_table[$i+1];
  2335. @@ -107,7 +107,7 @@
  2336. }
  2337. $i = 1;
  2338. $ups_cost = constant('MODULE_SHIPPING_UPS_COST_' . $i);
  2339. - $ups_table = split("[:,]" , $ups_cost);
  2340. + $ups_table = preg_split("/[:,]/" , $ups_cost);
  2341. for ($i=0; $i<sizeof($ups_table); $i+=2) {
  2342. if ($shipping_weight <= $ups_table[$i]) {
  2343. $diff = $ups_table[$i+1];
  2344. @@ -118,7 +118,7 @@
  2345. } else {
  2346. $shipping = -1;
  2347. $ups_cost = constant('MODULE_SHIPPING_UPS_COST_' . $i);
  2348. - $ups_table = split("[:,]" , $ups_cost);
  2349. + $ups_table = preg_split("/[:,]/" , $ups_cost);
  2350. for ($i=0; $i<sizeof($ups_table); $i+=2) {
  2351. if ($shipping_weight <= $ups_table[$i]) {
  2352. $shipping = $ups_table[$i+1];
  2353. diff -Naur xtcommerce.orig/includes/modules/shipping/zones.php xtcommerce/includes/modules/shipping/zones.php
  2354. --- xtcommerce.orig/includes/modules/shipping/zones.php 2005-04-29 04:40:58.000000000 +0200
  2355. +++ xtcommerce/includes/modules/shipping/zones.php 2010-08-11 14:24:37.000000000 +0200
  2356. @@ -138,7 +138,7 @@
  2357.  
  2358. for ($i=1; $i<=$this->num_zones; $i++) {
  2359. $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
  2360. - $country_zones = split("[,]", $countries_table);
  2361. + $country_zones = explode(",", $countries_table);
  2362. if (in_array($dest_country, $country_zones)) {
  2363. $dest_zone = $i;
  2364. break;
  2365. @@ -151,7 +151,7 @@
  2366. $shipping = -1;
  2367. $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);
  2368.  
  2369. - $zones_table = split("[:,]" , $zones_cost);
  2370. + $zones_table = preg_split("/[:,]/" , $zones_cost);
  2371. $size = sizeof($zones_table);
  2372. for ($i=0; $i<$size; $i+=2) {
  2373. if ($shipping_weight <= $zones_table[$i]) {
  2374. diff -Naur xtcommerce.orig/includes/nusoap/lib/class.nusoap_base.php xtcommerce/includes/nusoap/lib/class.nusoap_base.php
  2375. --- xtcommerce.orig/includes/nusoap/lib/class.nusoap_base.php 2006-06-13 03:12:03.000000000 +0200
  2376. +++ xtcommerce/includes/nusoap/lib/class.nusoap_base.php 2010-08-11 15:49:31.000000000 +0200
  2377. @@ -503,7 +503,7 @@
  2378. case (is_array($val) || $type):
  2379. // detect if struct or array
  2380. $valueType = $this->isArraySimpleOrStruct($val);
  2381. - if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
  2382. + if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){
  2383. $i = 0;
  2384. if(is_array($val) && count($val)> 0){
  2385. foreach($val as $v){
  2386. @@ -698,7 +698,7 @@
  2387. */
  2388. function expandQname($qname){
  2389. // get element prefix
  2390. - if(strpos($qname,':') && !ereg('^http://',$qname)){
  2391. + if(strpos($qname,':') && !preg_match('/^http:\/\//',$qname)){
  2392. // get unqualified name
  2393. $name = substr(strstr($qname,':'),1);
  2394. // get ns prefix
  2395. @@ -826,7 +826,7 @@
  2396. function timestamp_to_iso8601($timestamp,$utc=true){
  2397. $datestr = date('Y-m-d\TH:i:sO',$timestamp);
  2398. if($utc){
  2399. - $eregStr =
  2400. + $regStr =
  2401. '([0-9]{4})-'. // centuries & years CCYY-
  2402. '([0-9]{2})-'. // months MM-
  2403. '([0-9]{2})'. // days DD
  2404. @@ -836,7 +836,7 @@
  2405. '([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss...
  2406. '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
  2407.  
  2408. - if(ereg($eregStr,$datestr,$regs)){
  2409. + if(preg_match('/'.$regStr.'/',$datestr,$regs)){
  2410. return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
  2411. }
  2412. return false;
  2413. @@ -852,7 +852,7 @@
  2414. * @access public
  2415. */
  2416. function iso8601_to_timestamp($datestr){
  2417. - $eregStr =
  2418. + $regStr =
  2419. '([0-9]{4})-'. // centuries & years CCYY-
  2420. '([0-9]{2})-'. // months MM-
  2421. '([0-9]{2})'. // days DD
  2422. @@ -861,7 +861,7 @@
  2423. '([0-9]{2}):'. // minutes mm:
  2424. '([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss...
  2425. '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
  2426. - if(ereg($eregStr,$datestr,$regs)){
  2427. + if(preg_match('/'.$regStr.'/',$datestr,$regs)){
  2428. // not utc
  2429. if($regs[8] != 'Z'){
  2430. $op = substr($regs[8],0,1);
  2431. @@ -902,4 +902,4 @@
  2432. }
  2433.  
  2434.  
  2435. -?>
  2436. \ No newline at end of file
  2437. +?>
  2438. diff -Naur xtcommerce.orig/includes/nusoap/lib/class.soapclientw.php xtcommerce/includes/nusoap/lib/class.soapclientw.php
  2439. --- xtcommerce.orig/includes/nusoap/lib/class.soapclientw.php 2006-06-13 03:12:03.000000000 +0200
  2440. +++ xtcommerce/includes/nusoap/lib/class.soapclientw.php 2010-08-11 16:00:03.000000000 +0200
  2441. @@ -111,7 +111,7 @@
  2442.  
  2443. // instantiate wsdl object and parse wsdl file
  2444. $this->debug('instantiating wsdl class with doc: '.$endpoint);
  2445. - $this->wsdl =& new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout);
  2446. + $this->wsdl = new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout);
  2447. }
  2448. $this->appendDebug($this->wsdl->getDebug());
  2449. $this->wsdl->clearDebug();
  2450. @@ -359,7 +359,7 @@
  2451. // detect transport
  2452. switch(true){
  2453. // http(s)
  2454. - case ereg('^http',$this->endpoint):
  2455. + case preg_match('/^http/',$this->endpoint):
  2456. $this->debug('transporting via HTTP');
  2457. if($this->persistentConnection == true && is_object($this->persistentConnection)){
  2458. $http =& $this->persistentConnection;
  2459. @@ -381,10 +381,10 @@
  2460. $http->setEncoding($this->http_encoding);
  2461. }
  2462. $this->debug('sending message, length='.strlen($msg));
  2463. - if(ereg('^http:',$this->endpoint)){
  2464. + if(preg_match('/^http:/',$this->endpoint)){
  2465. //if(strpos($this->endpoint,'http:')){
  2466. $this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies);
  2467. - } elseif(ereg('^https',$this->endpoint)){
  2468. + } elseif(preg_match('/^https/',$this->endpoint)){
  2469. //} elseif(strpos($this->endpoint,'https:')){
  2470. //if(phpversion() == '4.3.0-dev'){
  2471. //$response = $http->send($msg,$timeout,$response_timeout);
  2472. @@ -442,7 +442,7 @@
  2473. if (strpos($headers['content-type'], '=')) {
  2474. $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
  2475. $this->debug('Got response encoding: ' . $enc);
  2476. - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
  2477. + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
  2478. $this->xml_encoding = strtoupper($enc);
  2479. } else {
  2480. $this->xml_encoding = 'US-ASCII';
  2481. diff -Naur xtcommerce.orig/includes/nusoap/lib/class.soap_parser.php xtcommerce/includes/nusoap/lib/class.soap_parser.php
  2482. --- xtcommerce.orig/includes/nusoap/lib/class.soap_parser.php 2005-08-04 12:53:46.000000000 +0200
  2483. +++ xtcommerce/includes/nusoap/lib/class.soap_parser.php 2010-08-11 15:47:17.000000000 +0200
  2484. @@ -205,7 +205,7 @@
  2485. $key_localpart = $this->getLocalPart($key);
  2486. // if ns declarations, add to class level array of valid namespaces
  2487. if($key_prefix == 'xmlns'){
  2488. - if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
  2489. + if(preg_match('/^http:\/\/www\.w3\.org\/[0-9]{4}\/XMLSchema$/',$value)){
  2490. $this->XMLSchemaVersion = $value;
  2491. $this->namespaces['xsd'] = $this->XMLSchemaVersion;
  2492. $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
  2493. @@ -229,7 +229,7 @@
  2494. // should do something here with the namespace of specified type?
  2495. } elseif($key_localpart == 'arrayType'){
  2496. $this->message[$pos]['type'] = 'array';
  2497. - /* do arrayType ereg here
  2498. + /* do arrayType regex here
  2499. [1] arrayTypeValue ::= atype asize
  2500. [2] atype ::= QName rank*
  2501. [3] rank ::= '[' (',')* ']'
  2502. @@ -237,8 +237,8 @@
  2503. [5] length ::= nextDimension* Digit+
  2504. [6] nextDimension ::= Digit+ ','
  2505. */
  2506. - $expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
  2507. - if(ereg($expr,$value,$regs)){
  2508. + $expr = '/([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]/';
  2509. + if(preg_match($expr,$value,$regs)){
  2510. $this->message[$pos]['typePrefix'] = $regs[1];
  2511. $this->message[$pos]['arrayTypePrefix'] = $regs[1];
  2512. if (isset($this->namespaces[$regs[1]])) {
  2513. @@ -596,4 +596,4 @@
  2514.  
  2515.  
  2516.  
  2517. -?>
  2518. \ No newline at end of file
  2519. +?>
  2520. diff -Naur xtcommerce.orig/includes/nusoap/lib/class.soap_server.php xtcommerce/includes/nusoap/lib/class.soap_server.php
  2521. --- xtcommerce.orig/includes/nusoap/lib/class.soap_server.php 2005-08-04 12:53:48.000000000 +0200
  2522. +++ xtcommerce/includes/nusoap/lib/class.soap_server.php 2010-08-11 15:51:30.000000000 +0200
  2523. @@ -240,7 +240,7 @@
  2524. }
  2525. $this->debug("In service, query string=$qs");
  2526.  
  2527. - if (ereg('wsdl', $qs) ){
  2528. + if (preg_match('/wsdl/', $qs) ){
  2529. $this->debug("In service, this is a request for WSDL");
  2530. if($this->externalWSDLURL){
  2531. if (strpos($this->externalWSDLURL,"://")!==false) { // assume URL
  2532. @@ -311,7 +311,7 @@
  2533. // get the character encoding of the incoming request
  2534. if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
  2535. $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1));
  2536. - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
  2537. + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
  2538. $this->xml_encoding = strtoupper($enc);
  2539. } else {
  2540. $this->xml_encoding = 'US-ASCII';
  2541. @@ -340,7 +340,7 @@
  2542. $enc = substr(strstr($v, '='), 1);
  2543. $enc = str_replace('"', '', $enc);
  2544. $enc = str_replace('\\', '', $enc);
  2545. - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
  2546. + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
  2547. $this->xml_encoding = strtoupper($enc);
  2548. } else {
  2549. $this->xml_encoding = 'US-ASCII';
  2550. @@ -374,7 +374,7 @@
  2551. $enc = substr(strstr($v, '='), 1);
  2552. $enc = str_replace('"', '', $enc);
  2553. $enc = str_replace('\\', '', $enc);
  2554. - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
  2555. + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
  2556. $this->xml_encoding = strtoupper($enc);
  2557. } else {
  2558. $this->xml_encoding = 'US-ASCII';
  2559. @@ -703,7 +703,7 @@
  2560. $payload .= $this->getDebugAsXMLComment();
  2561. }
  2562. $this->outgoing_headers[] = "Server: $this->title Server v$this->version";
  2563. - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
  2564. + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
  2565. $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
  2566. // Let the Web server decide about this
  2567. //$this->outgoing_headers[] = "Connection: Close\r\n";
  2568. @@ -791,7 +791,7 @@
  2569. if (strpos($headers['content-type'], '=')) {
  2570. $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
  2571. $this->debug('Got response encoding: ' . $enc);
  2572. - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
  2573. + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
  2574. $this->xml_encoding = strtoupper($enc);
  2575. } else {
  2576. $this->xml_encoding = 'US-ASCII';
  2577. @@ -1035,4 +1035,4 @@
  2578.  
  2579.  
  2580.  
  2581. -?>
  2582. \ No newline at end of file
  2583. +?>
  2584. diff -Naur xtcommerce.orig/includes/nusoap/lib/class.soap_transport_http.php xtcommerce/includes/nusoap/lib/class.soap_transport_http.php
  2585. --- xtcommerce.orig/includes/nusoap/lib/class.soap_transport_http.php 2006-06-13 03:12:03.000000000 +0200
  2586. +++ xtcommerce/includes/nusoap/lib/class.soap_transport_http.php 2010-08-11 15:50:07.000000000 +0200
  2587. @@ -49,7 +49,7 @@
  2588. function soap_transport_http($url){
  2589. parent::nusoap_base();
  2590. $this->setURL($url);
  2591. - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
  2592. + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
  2593. $this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
  2594. $this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']);
  2595. }
  2596. @@ -588,7 +588,7 @@
  2597. }
  2598. }
  2599. // remove 100 header
  2600. - if(isset($lb) && ereg('^HTTP/1.1 100',$data)){
  2601. + if(isset($lb) && preg_match('/^HTTP\/1\.1 100/',$data)){
  2602. unset($lb);
  2603. $data = '';
  2604. }//
  2605. @@ -741,7 +741,7 @@
  2606. curl_close($this->ch);
  2607.  
  2608. // remove 100 header(s)
  2609. - while (ereg('^HTTP/1.1 100',$data)) {
  2610. + while (preg_match('/^HTTP\/1\.1 100/',$data)) {
  2611. if ($pos = strpos($data,"\r\n\r\n")) {
  2612. $data = ltrim(substr($data,$pos));
  2613. } elseif($pos = strpos($data,"\n\n") ) {
  2614. @@ -932,7 +932,7 @@
  2615. */
  2616. function parseCookie($cookie_str) {
  2617. $cookie_str = str_replace('; ', ';', $cookie_str) . ';';
  2618. - $data = split(';', $cookie_str);
  2619. + $data = explode(';', $cookie_str);
  2620. $value_str = $data[0];
  2621.  
  2622. $cookie_param = 'domain=';
  2623. @@ -1035,4 +1035,4 @@
  2624. }
  2625.  
  2626.  
  2627. -?>
  2628. \ No newline at end of file
  2629. +?>
  2630. diff -Naur xtcommerce.orig/includes/nusoap/lib/class.wsdl.php xtcommerce/includes/nusoap/lib/class.wsdl.php
  2631. --- xtcommerce.orig/includes/nusoap/lib/class.wsdl.php 2005-08-04 12:53:50.000000000 +0200
  2632. +++ xtcommerce/includes/nusoap/lib/class.wsdl.php 2010-08-11 15:46:10.000000000 +0200
  2633. @@ -274,7 +274,7 @@
  2634. $this->currentSchema->schemaStartElement($parser, $name, $attrs);
  2635. $this->appendDebug($this->currentSchema->getDebug());
  2636. $this->currentSchema->clearDebug();
  2637. - } elseif (ereg('schema$', $name)) {
  2638. + } elseif (preg_match('/schema$/', $name)) {
  2639. $this->debug('Parsing WSDL schema');
  2640. // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
  2641. $this->status = 'schema';
  2642. @@ -293,7 +293,7 @@
  2643. if (count($attrs) > 0) {
  2644. // register namespace declarations
  2645. foreach($attrs as $k => $v) {
  2646. - if (ereg("^xmlns", $k)) {
  2647. + if (preg_match("/^xmlns/", $k)) {
  2648. if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
  2649. $this->namespaces[$ns_prefix] = $v;
  2650. } else {
  2651. @@ -318,7 +318,7 @@
  2652. $attrs = array();
  2653. }
  2654. // get element prefix, namespace and name
  2655. - if (ereg(':', $name)) {
  2656. + if (preg_match('/:/', $name)) {
  2657. // get ns prefix
  2658. $prefix = substr($name, 0, strpos($name, ':'));
  2659. // get ns
  2660. @@ -483,7 +483,7 @@
  2661. */
  2662. function end_element($parser, $name){
  2663. // unset schema status
  2664. - if (/*ereg('types$', $name) ||*/ ereg('schema$', $name)) {
  2665. + if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
  2666. $this->status = "";
  2667. $this->appendDebug($this->currentSchema->getDebug());
  2668. $this->currentSchema->clearDebug();
  2669. @@ -1724,4 +1724,4 @@
  2670. }
  2671. }
  2672.  
  2673. -?>
  2674. \ No newline at end of file
  2675. +?>
  2676. diff -Naur xtcommerce.orig/includes/nusoap/lib/class.xmlschema.php xtcommerce/includes/nusoap/lib/class.xmlschema.php
  2677. --- xtcommerce.orig/includes/nusoap/lib/class.xmlschema.php 2005-08-04 12:53:52.000000000 +0200
  2678. +++ xtcommerce/includes/nusoap/lib/class.xmlschema.php 2010-08-11 15:46:47.000000000 +0200
  2679. @@ -186,7 +186,7 @@
  2680. if(count($attrs) > 0){
  2681. foreach($attrs as $k => $v){
  2682. // if ns declarations, add to class level array of valid namespaces
  2683. - if(ereg("^xmlns",$k)){
  2684. + if(preg_match("/^xmlns/",$k)){
  2685. //$this->xdebug("$k: $v");
  2686. //$this->xdebug('ns_prefix: '.$this->getPrefix($k));
  2687. if($ns_prefix = substr(strrchr($k,':'),1)){
  2688. @@ -296,7 +296,7 @@
  2689. // minOccurs="0" maxOccurs="unbounded" />
  2690. // </sequence>
  2691. // </complexType>
  2692. - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
  2693. + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
  2694. $this->xdebug('complexType is unusual array');
  2695. $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
  2696. } else {
  2697. @@ -315,7 +315,7 @@
  2698. // minOccurs="0" maxOccurs="unbounded" />
  2699. // </sequence>
  2700. // </complexType>
  2701. - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
  2702. + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
  2703. $this->xdebug('complexType is unusual array');
  2704. $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
  2705. } else {
  2706. @@ -713,7 +713,7 @@
  2707. } elseif(isset($this->attributes[$type])){
  2708. $this->xdebug("in getTypeDef, found attribute $type");
  2709. return $this->attributes[$type];
  2710. - } elseif (ereg('_ContainedType$', $type)) {
  2711. + } elseif (preg_match('/_ContainedType$/', $type)) {
  2712. $this->xdebug("in getTypeDef, have an untyped element $type");
  2713. $typeDef['typeClass'] = 'simpleType';
  2714. $typeDef['phpType'] = 'scalar';
  2715. @@ -903,4 +903,4 @@
  2716.  
  2717.  
  2718.  
  2719. -?>
  2720. \ No newline at end of file
  2721. +?>
  2722. diff -Naur xtcommerce.orig/includes/nusoap/lib/nusoapmime.php xtcommerce/includes/nusoap/lib/nusoapmime.php
  2723. --- xtcommerce.orig/includes/nusoap/lib/nusoapmime.php 2006-06-13 03:12:03.000000000 +0200
  2724. +++ xtcommerce/includes/nusoap/lib/nusoapmime.php 2010-08-11 16:00:08.000000000 +0200
  2725. @@ -127,7 +127,7 @@
  2726. function getHTTPBody($soapmsg) {
  2727. if (count($this->requestAttachments) > 0) {
  2728. $params['content_type'] = 'multipart/related; type=text/xml';
  2729. - $mimeMessage =& new Mail_mimePart('', $params);
  2730. + $mimeMessage = new Mail_mimePart('', $params);
  2731. unset($params);
  2732.  
  2733. $params['content_type'] = 'text/xml';
  2734. @@ -347,7 +347,7 @@
  2735. function getHTTPBody($soapmsg) {
  2736. if (count($this->responseAttachments) > 0) {
  2737. $params['content_type'] = 'multipart/related; type=text/xml';
  2738. - $mimeMessage =& new Mail_mimePart('', $params);
  2739. + $mimeMessage = new Mail_mimePart('', $params);
  2740. unset($params);
  2741.  
  2742. $params['content_type'] = 'text/xml';
  2743. diff -Naur xtcommerce.orig/includes/nusoap/lib/nusoap.php xtcommerce/includes/nusoap/lib/nusoap.php
  2744. --- xtcommerce.orig/includes/nusoap/lib/nusoap.php 2006-06-13 03:12:03.000000000 +0200
  2745. +++ xtcommerce/includes/nusoap/lib/nusoap.php 2010-08-11 15:59:52.000000000 +0200
  2746. @@ -503,7 +503,7 @@
  2747. case (is_array($val) || $type):
  2748. // detect if struct or array
  2749. $valueType = $this->isArraySimpleOrStruct($val);
  2750. - if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
  2751. + if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){
  2752. $i = 0;
  2753. if(is_array($val) && count($val)> 0){
  2754. foreach($val as $v){
  2755. @@ -698,7 +698,7 @@
  2756. */
  2757. function expandQname($qname){
  2758. // get element prefix
  2759. - if(strpos($qname,':') && !ereg('^http://',$qname)){
  2760. + if(strpos($qname,':') && !preg_match('/^http:\/\//',$qname)){
  2761. // get unqualified name
  2762. $name = substr(strstr($qname,':'),1);
  2763. // get ns prefix
  2764. @@ -826,7 +826,7 @@
  2765. function timestamp_to_iso8601($timestamp,$utc=true){
  2766. $datestr = date('Y-m-d\TH:i:sO',$timestamp);
  2767. if($utc){
  2768. - $eregStr =
  2769. + $regStr =
  2770. '([0-9]{4})-'. // centuries & years CCYY-
  2771. '([0-9]{2})-'. // months MM-
  2772. '([0-9]{2})'. // days DD
  2773. @@ -836,7 +836,7 @@
  2774. '([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss...
  2775. '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
  2776.  
  2777. - if(ereg($eregStr,$datestr,$regs)){
  2778. + if(preg_match('/'.$regStr.'/',$datestr,$regs)){
  2779. return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
  2780. }
  2781. return false;
  2782. @@ -852,7 +852,7 @@
  2783. * @access public
  2784. */
  2785. function iso8601_to_timestamp($datestr){
  2786. - $eregStr =
  2787. + $regStr =
  2788. '([0-9]{4})-'. // centuries & years CCYY-
  2789. '([0-9]{2})-'. // months MM-
  2790. '([0-9]{2})'. // days DD
  2791. @@ -861,7 +861,7 @@
  2792. '([0-9]{2}):'. // minutes mm:
  2793. '([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss...
  2794. '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
  2795. - if(ereg($eregStr,$datestr,$regs)){
  2796. + if(preg_match('/'.$regStr.'/',$datestr,$regs)){
  2797. // not utc
  2798. if($regs[8] != 'Z'){
  2799. $op = substr($regs[8],0,1);
  2800. @@ -1171,7 +1171,7 @@
  2801. if(count($attrs) > 0){
  2802. foreach($attrs as $k => $v){
  2803. // if ns declarations, add to class level array of valid namespaces
  2804. - if(ereg("^xmlns",$k)){
  2805. + if(preg_match("/^xmlns/",$k)){
  2806. //$this->xdebug("$k: $v");
  2807. //$this->xdebug('ns_prefix: '.$this->getPrefix($k));
  2808. if($ns_prefix = substr(strrchr($k,':'),1)){
  2809. @@ -1281,7 +1281,7 @@
  2810. // minOccurs="0" maxOccurs="unbounded" />
  2811. // </sequence>
  2812. // </complexType>
  2813. - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
  2814. + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
  2815. $this->xdebug('complexType is unusual array');
  2816. $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
  2817. } else {
  2818. @@ -1300,7 +1300,7 @@
  2819. // minOccurs="0" maxOccurs="unbounded" />
  2820. // </sequence>
  2821. // </complexType>
  2822. - if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
  2823. + if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
  2824. $this->xdebug('complexType is unusual array');
  2825. $this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
  2826. } else {
  2827. @@ -1698,7 +1698,7 @@
  2828. } elseif(isset($this->attributes[$type])){
  2829. $this->xdebug("in getTypeDef, found attribute $type");
  2830. return $this->attributes[$type];
  2831. - } elseif (ereg('_ContainedType$', $type)) {
  2832. + } elseif (preg_match('/_ContainedType$/', $type)) {
  2833. $this->xdebug("in getTypeDef, have an untyped element $type");
  2834. $typeDef['typeClass'] = 'simpleType';
  2835. $typeDef['phpType'] = 'scalar';
  2836. @@ -2041,7 +2041,7 @@
  2837. function soap_transport_http($url){
  2838. parent::nusoap_base();
  2839. $this->setURL($url);
  2840. - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
  2841. + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
  2842. $this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
  2843. $this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']);
  2844. }
  2845. @@ -2580,7 +2580,7 @@
  2846. }
  2847. }
  2848. // remove 100 header
  2849. - if(isset($lb) && ereg('^HTTP/1.1 100',$data)){
  2850. + if(isset($lb) && preg_match('/^HTTP\/1\.1 100/',$data)){
  2851. unset($lb);
  2852. $data = '';
  2853. }//
  2854. @@ -2733,7 +2733,7 @@
  2855. curl_close($this->ch);
  2856.  
  2857. // remove 100 header(s)
  2858. - while (ereg('^HTTP/1.1 100',$data)) {
  2859. + while (preg_match('/^HTTP\/1\.1 100/',$data)) {
  2860. if ($pos = strpos($data,"\r\n\r\n")) {
  2861. $data = ltrim(substr($data,$pos));
  2862. } elseif($pos = strpos($data,"\n\n") ) {
  2863. @@ -2924,7 +2924,7 @@
  2864. */
  2865. function parseCookie($cookie_str) {
  2866. $cookie_str = str_replace('; ', ';', $cookie_str) . ';';
  2867. - $data = split(';', $cookie_str);
  2868. + $data = explode(';', $cookie_str);
  2869. $value_str = $data[0];
  2870.  
  2871. $cookie_param = 'domain=';
  2872. @@ -3267,7 +3267,7 @@
  2873. }
  2874. $this->debug("In service, query string=$qs");
  2875.  
  2876. - if (ereg('wsdl', $qs) ){
  2877. + if (preg_match('/wsdl/', $qs) ){
  2878. $this->debug("In service, this is a request for WSDL");
  2879. if($this->externalWSDLURL){
  2880. if (strpos($this->externalWSDLURL,"://")!==false) { // assume URL
  2881. @@ -3338,7 +3338,7 @@
  2882. // get the character encoding of the incoming request
  2883. if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
  2884. $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1));
  2885. - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
  2886. + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
  2887. $this->xml_encoding = strtoupper($enc);
  2888. } else {
  2889. $this->xml_encoding = 'US-ASCII';
  2890. @@ -3367,7 +3367,7 @@
  2891. $enc = substr(strstr($v, '='), 1);
  2892. $enc = str_replace('"', '', $enc);
  2893. $enc = str_replace('\\', '', $enc);
  2894. - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
  2895. + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
  2896. $this->xml_encoding = strtoupper($enc);
  2897. } else {
  2898. $this->xml_encoding = 'US-ASCII';
  2899. @@ -3401,7 +3401,7 @@
  2900. $enc = substr(strstr($v, '='), 1);
  2901. $enc = str_replace('"', '', $enc);
  2902. $enc = str_replace('\\', '', $enc);
  2903. - if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
  2904. + if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
  2905. $this->xml_encoding = strtoupper($enc);
  2906. } else {
  2907. $this->xml_encoding = 'US-ASCII';
  2908. @@ -3730,7 +3730,7 @@
  2909. $payload .= $this->getDebugAsXMLComment();
  2910. }
  2911. $this->outgoing_headers[] = "Server: $this->title Server v$this->version";
  2912. - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
  2913. + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
  2914. $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
  2915. // Let the Web server decide about this
  2916. //$this->outgoing_headers[] = "Connection: Close\r\n";
  2917. @@ -3818,7 +3818,7 @@
  2918. if (strpos($headers['content-type'], '=')) {
  2919. $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
  2920. $this->debug('Got response encoding: ' . $enc);
  2921. - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
  2922. + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
  2923. $this->xml_encoding = strtoupper($enc);
  2924. } else {
  2925. $this->xml_encoding = 'US-ASCII';
  2926. @@ -4336,7 +4336,7 @@
  2927. $this->currentSchema->schemaStartElement($parser, $name, $attrs);
  2928. $this->appendDebug($this->currentSchema->getDebug());
  2929. $this->currentSchema->clearDebug();
  2930. - } elseif (ereg('schema$', $name)) {
  2931. + } elseif (preg_match('/schema$/', $name)) {
  2932. $this->debug('Parsing WSDL schema');
  2933. // $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
  2934. $this->status = 'schema';
  2935. @@ -4355,7 +4355,7 @@
  2936. if (count($attrs) > 0) {
  2937. // register namespace declarations
  2938. foreach($attrs as $k => $v) {
  2939. - if (ereg("^xmlns", $k)) {
  2940. + if (preg_match("/^xmlns/", $k)) {
  2941. if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
  2942. $this->namespaces[$ns_prefix] = $v;
  2943. } else {
  2944. @@ -4380,7 +4380,7 @@
  2945. $attrs = array();
  2946. }
  2947. // get element prefix, namespace and name
  2948. - if (ereg(':', $name)) {
  2949. + if (preg_match('/:/', $name)) {
  2950. // get ns prefix
  2951. $prefix = substr($name, 0, strpos($name, ':'));
  2952. // get ns
  2953. @@ -4545,7 +4545,7 @@
  2954. */
  2955. function end_element($parser, $name){
  2956. // unset schema status
  2957. - if (/*ereg('types$', $name) ||*/ ereg('schema$', $name)) {
  2958. + if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
  2959. $this->status = "";
  2960. $this->appendDebug($this->currentSchema->getDebug());
  2961. $this->currentSchema->clearDebug();
  2962. @@ -5991,7 +5991,7 @@
  2963. $key_localpart = $this->getLocalPart($key);
  2964. // if ns declarations, add to class level array of valid namespaces
  2965. if($key_prefix == 'xmlns'){
  2966. - if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
  2967. + if(preg_match('/^http:\/\/www\.w3\.org\/[0-9]{4}\/XMLSchema$/',$value)){
  2968. $this->XMLSchemaVersion = $value;
  2969. $this->namespaces['xsd'] = $this->XMLSchemaVersion;
  2970. $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
  2971. @@ -6015,7 +6015,7 @@
  2972. // should do something here with the namespace of specified type?
  2973. } elseif($key_localpart == 'arrayType'){
  2974. $this->message[$pos]['type'] = 'array';
  2975. - /* do arrayType ereg here
  2976. + /* do arrayType regex here
  2977. [1] arrayTypeValue ::= atype asize
  2978. [2] atype ::= QName rank*
  2979. [3] rank ::= '[' (',')* ']'
  2980. @@ -6023,8 +6023,8 @@
  2981. [5] length ::= nextDimension* Digit+
  2982. [6] nextDimension ::= Digit+ ','
  2983. */
  2984. - $expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
  2985. - if(ereg($expr,$value,$regs)){
  2986. + $expr = '/([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]/';
  2987. + if(preg_match($expr,$value,$regs)){
  2988. $this->message[$pos]['typePrefix'] = $regs[1];
  2989. $this->message[$pos]['arrayTypePrefix'] = $regs[1];
  2990. if (isset($this->namespaces[$regs[1]])) {
  2991. @@ -6493,7 +6493,7 @@
  2992.  
  2993. // instantiate wsdl object and parse wsdl file
  2994. $this->debug('instantiating wsdl class with doc: '.$endpoint);
  2995. - $this->wsdl =& new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout);
  2996. + $this->wsdl = new wsdl($this->wsdlFile,$this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword,$this->timeout,$this->response_timeout);
  2997. }
  2998. $this->appendDebug($this->wsdl->getDebug());
  2999. $this->wsdl->clearDebug();
  3000. @@ -6741,7 +6741,7 @@
  3001. // detect transport
  3002. switch(true){
  3003. // http(s)
  3004. - case ereg('^http',$this->endpoint):
  3005. + case preg_match('/^http/',$this->endpoint):
  3006. $this->debug('transporting via HTTP');
  3007. if($this->persistentConnection == true && is_object($this->persistentConnection)){
  3008. $http =& $this->persistentConnection;
  3009. @@ -6763,10 +6763,10 @@
  3010. $http->setEncoding($this->http_encoding);
  3011. }
  3012. $this->debug('sending message, length='.strlen($msg));
  3013. - if(ereg('^http:',$this->endpoint)){
  3014. + if(preg_match('/^http:/',$this->endpoint)){
  3015. //if(strpos($this->endpoint,'http:')){
  3016. $this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies);
  3017. - } elseif(ereg('^https',$this->endpoint)){
  3018. + } elseif(preg_match('/^https/',$this->endpoint)){
  3019. //} elseif(strpos($this->endpoint,'https:')){
  3020. //if(phpversion() == '4.3.0-dev'){
  3021. //$response = $http->send($msg,$timeout,$response_timeout);
  3022. @@ -6824,7 +6824,7 @@
  3023. if (strpos($headers['content-type'], '=')) {
  3024. $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
  3025. $this->debug('Got response encoding: ' . $enc);
  3026. - if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
  3027. + if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
  3028. $this->xml_encoding = strtoupper($enc);
  3029. } else {
  3030. $this->xml_encoding = 'US-ASCII';
  3031. @@ -7238,4 +7238,4 @@
  3032. return true;
  3033. }
  3034. }
  3035. -?>
  3036. \ No newline at end of file
  3037. +?>
  3038. diff -Naur xtcommerce.orig/media_content.php xtcommerce/media_content.php
  3039. --- xtcommerce.orig/media_content.php 2005-03-13 10:16:10.000000000 +0100
  3040. +++ xtcommerce/media_content.php 2010-08-11 15:40:10.000000000 +0200
  3041. @@ -53,7 +53,7 @@
  3042. if (strpos($content_data['content_file'], '.txt'))
  3043. echo '<pre>';
  3044.  
  3045. - if (eregi('.gif', $content_data['content_file']) or eregi('.jpg', $content_data['content_file']) or eregi('.png', $content_data['content_file']) or eregi('.tif', $content_data['content_file']) or eregi('.bmp', $content_data['content_file'])) {
  3046. + if (preg_match('/\.gif/i', $content_data['content_file']) or preg_match('/\.jpg/i', $content_data['content_file']) or preg_match('/\.png/i', $content_data['content_file']) or preg_match('/\.tif/i', $content_data['content_file']) or preg_match('/\.bmp/i', $content_data['content_file'])) {
  3047. echo '<table align="center" valign="middle" width="100%" height="100%" border=0><tr><td class="main" align="middle" valign="middle">';
  3048.  
  3049. echo xtc_image(DIR_WS_CATALOG.'media/products/'.$content_data['content_file']);
  3050. @@ -73,4 +73,4 @@
  3051. }
  3052. ?>
  3053. </body>
  3054. -</html>
  3055. \ No newline at end of file
  3056. +</html>
  3057. diff -Naur xtcommerce.orig/popup_coupon_help.php xtcommerce/popup_coupon_help.php
  3058. --- xtcommerce.orig/popup_coupon_help.php 2005-10-18 17:49:16.000000000 +0200
  3059. +++ xtcommerce/popup_coupon_help.php 2010-08-11 14:46:56.000000000 +0200
  3060. @@ -54,7 +54,7 @@
  3061. $coupon_get = xtc_db_query("select restrict_to_categories from ".TABLE_COUPONS." where coupon_id='".(int)$_GET['cID']."'");
  3062. $get_result = xtc_db_fetch_array($coupon_get);
  3063.  
  3064. -$cat_ids = split("[,]", $get_result['restrict_to_categories']);
  3065. +$cat_ids = explode(",", $get_result['restrict_to_categories']);
  3066. for ($i = 0; $i < count($cat_ids); $i ++) {
  3067. $result = xtc_db_query("SELECT * FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd WHERE c.categories_id = cd.categories_id and cd.language_id = '".$_SESSION['languages_id']."' and c.categories_id='".$cat_ids[$i]."'");
  3068. if ($row = xtc_db_fetch_array($result)) {
  3069. @@ -68,7 +68,7 @@
  3070. $coupon_get = xtc_db_query("select restrict_to_products from ".TABLE_COUPONS." where coupon_id='".(int)$_GET['cID']."'");
  3071. $get_result = xtc_db_fetch_array($coupon_get);
  3072.  
  3073. -$pr_ids = split("[,]", $get_result['restrict_to_products']);
  3074. +$pr_ids = explode(",", $get_result['restrict_to_products']);
  3075. for ($i = 0; $i < count($pr_ids); $i ++) {
  3076. $result = xtc_db_query("SELECT * FROM ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd WHERE p.products_id = pd.products_id and pd.language_id = '".$_SESSION['languages_id']."'and p.products_id = '".$pr_ids[$i]."'");
  3077. if ($row = xtc_db_fetch_array($result)) {
  3078. @@ -86,4 +86,4 @@
  3079. $smarty->caching = 0;
  3080. $smarty->display(CURRENT_TEMPLATE.'/module/popup_coupon_help.html');
  3081. include ('includes/application_bottom.php');
  3082. -?>
  3083. \ No newline at end of file
  3084. +?>
  3085. diff -Naur xtcommerce.orig/templates/xtc4/source/boxes/categories.php xtcommerce/templates/xtc4/source/boxes/categories.php
  3086. --- xtcommerce.orig/templates/xtc4/source/boxes/categories.php 2005-10-12 18:21:30.000000000 +0200
  3087. +++ xtcommerce/templates/xtc4/source/boxes/categories.php 2010-08-11 14:46:05.000000000 +0200
  3088. @@ -80,7 +80,7 @@
  3089. //------------------------
  3090. if ($cPath) {
  3091. $new_path = '';
  3092. - $id = split('_', $cPath);
  3093. + $id = explode('_', $cPath);
  3094. reset($id);
  3095. while (list ($key, $value) = each($id)) {
  3096. unset ($prev_id);
  3097. @@ -128,4 +128,4 @@
  3098. }
  3099.  
  3100. $smarty->assign('box_CATEGORIES', $box_categories);
  3101. -?>
  3102. \ No newline at end of file
  3103. +?>
  3104.