Permalink
Browse files

Return to preg_match as ctype may be not compiled on php on some envi…

…ronment.
  • Loading branch information...
1 parent b26f367 commit d2063dc2b580fcf2e30ee663da251b33cfffc998 @acidvertigo acidvertigo committed Aug 17, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 catalog/includes/functions/sessions.php
View
6 catalog/includes/functions/sessions.php
@@ -74,19 +74,19 @@ function tep_session_start() {
$sane_session_id = true;
if (isset($_GET[tep_session_name()])) {
- if (ctype_alnum($_GET[tep_session_name()]) == false) {
+ if (preg_match('/^[a-zA-Z0-9]+$/', $_GET[tep_session_name()]) == false) {
unset($_GET[tep_session_name()]);
$sane_session_id = false;
}
} elseif (isset($_POST[tep_session_name()])) {
- if (ctype_alnum($_POST[tep_session_name()]) == false) {
+ if (preg_match('/^[a-zA-Z0-9]+$/', $_POST[tep_session_name()]) == false) {
unset($_POST[tep_session_name()]);
$sane_session_id = false;
}
} elseif (isset($_COOKIE[tep_session_name()])) {
- if (ctype_alnum($_COOKIE[tep_session_name()]) == false) {
+ if (preg_match('/^[a-zA-Z0-9]+$/', $_COOKIE[tep_session_name()]) == false) {
$session_data = session_get_cookie_params();
setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);

0 comments on commit d2063dc

Please sign in to comment.