Skip to content

Commit

Permalink
Commit cleanup and fix some warnings in phplot and typo in banners_in…
Browse files Browse the repository at this point in the history
…fobox for OSC-999
  • Loading branch information
Mark Evans authored and haraldpdl committed Sep 10, 2009
1 parent 1bfed2f commit 1510126
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion catalog/admin/cache.php
Expand Up @@ -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;
}
Expand Down
10 changes: 5 additions & 5 deletions catalog/admin/includes/classes/phplot.php
Expand Up @@ -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;$i<count($str);$i++) {
ImageStringUp($this->img, $which_font, ($i*$height + $which_xpos), $which_ypos, $str[$i], $which_color);
Expand All @@ -686,9 +686,9 @@ function DrawText($which_font,$which_angle,$which_xpos,$which_ypos,$which_color,
for($i=0;$i<count($str);$i++) {
if ($which_halign == 'center') {
$xpos = $which_xpos - strlen($str[$i]) * $width/2;
ImageString($this->img, $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);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions catalog/admin/includes/functions/validations.php
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion catalog/admin/includes/graphs/banner_infobox.php
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion catalog/admin/whos_online.php
Expand Up @@ -84,7 +84,7 @@
<td class="dataTableContent" align="center"><?php echo $whos_online['ip_address']; ?></td>
<td class="dataTableContent"><?php echo date('H:i:s', $whos_online['time_entry']); ?></td>
<td class="dataTableContent" align="center"><?php echo date('H:i:s', $whos_online['time_last_click']); ?></td>
<td class="dataTableContent"><?php if (preg_match('/^(.*)/i' . tep_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>
<td class="dataTableContent"><?php if (preg_match('/^(.*)' . tep_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>
</tr>
<?php
}
Expand Down
4 changes: 2 additions & 2 deletions catalog/includes/functions/validations.php
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 1510126

Please sign in to comment.