return addslashes($input_arr); } } foreach ($_POST as $key => $value) { if (is_array($value)) { $_POST[$key] = addslashes_array($value); } else { $_POST[$key] = addslashes($value); } } unset($key, $value); } ////////////////////////////////////////////////// $output = ''; if ($cartType == "empty") { $shopCart->emptySavedData(); return; } elseif (isset($_POST['shk-id'])) { $thisPage = $modx->documentIdentifier; $orderFormPageUrl = $modx->makeUrl($shkconf['orderFormPage'], '', '', 'full'); $purchaseArray = $_POST; $shopCart->savePurchaseData($purchaseArray); $modx->sendRedirect($_SERVER['HTTP_REFERER'], 0, 'REDIRECT_HEADER'); } elseif (isset($_GET['shk_action'])) { $action = addslashes($_GET['shk_action']); switch ($action) { case "empty": $shopCart->emptySavedData(); break; case "del": $item_index = isset($_GET['n']) && is_numeric($_GET['n']) ? $_GET['n'] : "";