From 15101263fa27b523139b405f99b1613c71a8e2c1 Mon Sep 17 00:00:00 2001 From: Mark Evans Date: Sun, 6 Sep 2009 13:31:21 +0100 Subject: [PATCH] Commit cleanup and fix some warnings in phplot and typo in banners_infobox for OSC-999 --- catalog/admin/cache.php | 2 +- catalog/admin/includes/classes/phplot.php | 10 +++++----- catalog/admin/includes/functions/validations.php | 4 ++-- catalog/admin/includes/graphs/banner_infobox.php | 2 +- catalog/admin/whos_online.php | 2 +- catalog/includes/functions/validations.php | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/catalog/admin/cache.php b/catalog/admin/cache.php index d27dc9f7f..553450a37 100644 --- a/catalog/admin/cache.php +++ b/catalog/admin/cache.php @@ -91,7 +91,7 @@ while ($cache_file = $dir->read()) { $cached_file = preg_replace('/-language/', '-' . $language, $cache_blocks[$i]['file']); - if (preg_match('/^/' . $cached_file, $cache_file)) { + if (preg_match('/^' . $cached_file. '/', $cache_file)) { $cache_mtime = strftime(DATE_TIME_FORMAT, filemtime(DIR_FS_CACHE . $cache_file)); break; } diff --git a/catalog/admin/includes/classes/phplot.php b/catalog/admin/includes/classes/phplot.php index bbc74ab95..667600432 100644 --- a/catalog/admin/includes/classes/phplot.php +++ b/catalog/admin/includes/classes/phplot.php @@ -672,12 +672,12 @@ function DrawText($which_font,$which_angle,$which_xpos,$which_ypos,$which_color, $which_xpos, $which_ypos, $which_color, $which_font, $which_text); } else { if ($which_valign == 'top') { - $which_ypos = $which_ypos - ImageFontHeight($which_font); + $which_ypos = $which_ypos - ImageFontHeight((int)$which_font); } $which_text = preg_replace("/\r/","",$which_text); $str = explode("\n",$which_text); //multiple lines submitted by Remi Ricard - $height = ImageFontHeight($which_font); - $width = ImageFontWidth($which_font); + $height = ImageFontHeight((int)$which_font); + $width = ImageFontWidth((int)$which_font); if ($which_angle == 90) { //Vertical Code Submitted by Marlin Viss for($i=0;$iimg, $which_font, ($i*$height + $which_xpos), $which_ypos, $str[$i], $which_color); @@ -686,9 +686,9 @@ function DrawText($which_font,$which_angle,$which_xpos,$which_ypos,$which_color, for($i=0;$iimg, $which_font, $xpos, ($i*$height + $which_ypos), $str[$i], $which_color); + ImageString($this->img, (int)$which_font, $xpos, ($i*$height + $which_ypos), $str[$i], $which_color); } else { - ImageString($this->img, $which_font, $which_xpos, ($i*$height + $which_ypos), $str[$i], $which_color); + ImageString($this->img, (int)$which_font, $which_xpos, ($i*$height + $which_ypos), $str[$i], $which_color); } } } diff --git a/catalog/admin/includes/functions/validations.php b/catalog/admin/includes/functions/validations.php index 8687bd888..b93d5fbe5 100644 --- a/catalog/admin/includes/functions/validations.php +++ b/catalog/admin/includes/functions/validations.php @@ -89,12 +89,12 @@ function tep_validate_email($email) { $tld = trim($words[0]); // TLDs should be 3 letters or more if (preg_match('/^[a-z]{3,}$/i', $tld) == 1) { - $tld_pattern .= '/^' . $tld . '$|/i'; + $tld_pattern .= '^' . $tld . '$|'; } } // Remove last '|' $tld_pattern = substr($tld_pattern, 0, -1); - if (preg_match("$tld_pattern", $top_level_domain) == 0) { + if (preg_match("/$tld_pattern/i", $top_level_domain) == 0) { $valid_address = false; } } diff --git a/catalog/admin/includes/graphs/banner_infobox.php b/catalog/admin/includes/graphs/banner_infobox.php index b5453587b..dbdeaa8cf 100644 --- a/catalog/admin/includes/graphs/banner_infobox.php +++ b/catalog/admin/includes/graphs/banner_infobox.php @@ -36,7 +36,7 @@ $graph->SetMarginsPixels(15,15,15,30); $graph->SetTitleFontSize('4'); - $graph->SetTitle('TEXT_BANNERS_LAST_3_DAYS'); + $graph->SetTitle(TEXT_BANNERS_LAST_3_DAYS); $graph->SetDataValues($stats); $graph->SetDataColors(array('blue','red'),array('blue', 'red')); diff --git a/catalog/admin/whos_online.php b/catalog/admin/whos_online.php index b4d224e6a..170e7266d 100644 --- a/catalog/admin/whos_online.php +++ b/catalog/admin/whos_online.php @@ -84,7 +84,7 @@ -   +