Skip to content

Commit

Permalink
Fix ereg->preg updates
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldpdl committed Sep 10, 2009
1 parent 8a9dd05 commit bc2bcd9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion catalog/admin/file_manager.php
Expand Up @@ -26,7 +26,7 @@

if (!is_dir($current_path)) $current_path = DIR_FS_DOCUMENT_ROOT;

if (!preg_match('/^/' . DIR_FS_DOCUMENT_ROOT, $current_path)) $current_path = DIR_FS_DOCUMENT_ROOT;
if (!preg_match('/^' . DIR_FS_DOCUMENT_ROOT . '/', $current_path)) $current_path = DIR_FS_DOCUMENT_ROOT;

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

Expand Down
4 changes: 2 additions & 2 deletions catalog/admin/includes/functions/general.php
Expand Up @@ -146,7 +146,7 @@ function tep_date_short($raw_date) {
if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
} else {
return preg_replace('/2037/' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
return preg_replace('/2037$/', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
}

}
Expand Down Expand Up @@ -939,7 +939,7 @@ function tep_reset_cache_block($cache_block) {
$languages = tep_get_languages();
for ($j=0, $k=sizeof($languages); $j<$k; $j++) {
$cached_file_unlink = preg_replace('/-language/', '-' . $languages[$j]['directory'], $cached_file);
if (preg_match('/^/' . $cached_file_unlink, $cache_file)) {
if (preg_match('/^' . $cached_file_unlink . '/', $cache_file)) {
@unlink(DIR_FS_CACHE . $cache_file);
}
}
Expand Down
2 changes: 1 addition & 1 deletion catalog/includes/functions/general.php
Expand Up @@ -584,7 +584,7 @@ function tep_date_short($raw_date) {
if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
} else {
return preg_replace('/2037/' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
return preg_replace('/2037$/', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
}
}

Expand Down

0 comments on commit bc2bcd9

Please sign in to comment.