diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php
index 9628b318..fcd23954 100644
--- a/core/imageboard.pack.php
+++ b/core/imageboard.pack.php
@@ -284,8 +284,11 @@ class Image {
*/
public function get_thumb_link() {
global $config;
- if(strlen($config->get_string('image_tlink')) > 0) {
- return $this->parse_link_template($config->get_string('image_tlink'));
+
+ $image_tlink = $config->get_string('image_tlink'); // store a copy for speed.
+
+ if( !empty($image_tlink) ) { /* empty is faster than strlen */
+ return $this->parse_link_template($image_tlink);
}
else if($config->get_bool('nice_urls', false)) {
return $this->parse_link_template(make_link('_thumbs/$hash/thumb.jpg'));
diff --git a/ext/index/theme.php b/ext/index/theme.php
index 56775736..2263d3db 100644
--- a/ext/index/theme.php
+++ b/ext/index/theme.php
@@ -69,12 +69,12 @@ EOD;
$next = $page_number + 1;
$u_tags = url_escape(implode(" ", $search_terms));
- $query = empty($u_tags) ? "" : "/$u_tags";
+ $query = empty($u_tags) ? "" : '/'.$u_tags;
- $h_prev = ($page_number <= 1) ? "Prev" : "Prev";
+ $h_prev = ($page_number <= 1) ? "Prev" : 'Prev';
$h_index = "Index";
- $h_next = ($page_number >= $total_pages) ? "Next" : "Next";
+ $h_next = ($page_number >= $total_pages) ? "Next" : 'Next';
$h_search_string = html_escape(implode(" ", $search_terms));
$h_search_link = make_link();
@@ -102,7 +102,7 @@ EOD;
";
- return "$h_prev | $h_index | $h_next
$h_search";
+ return $h_prev.' | '.$h_index.' | '.$h_next.'
'.$h_search;
}
protected function build_table($images, $query) {
diff --git a/themes/default/themelet.class.php b/themes/default/themelet.class.php
index 08b4b694..27a6a280 100644
--- a/themes/default/themelet.class.php
+++ b/themes/default/themelet.class.php
@@ -29,13 +29,13 @@ class Themelet {
*/
public function build_thumb_html(Image $image, $query=null) {
global $config;
- $i_id = int_escape($image->id);
- $h_view_link = make_link("post/view/$i_id", $query);
+ $i_id = (int) $image->id;
+ $h_view_link = make_link('post/view/'.$i_id, $query);
$h_thumb_link = $image->get_thumb_link();
// Removes the size tag if the file is an mp3
- if($image->ext == 'mp3'){
+ if($image->ext === 'mp3'){
$iitip = $image->get_tooltip();
$mp3tip = array("0x0");
$h_tip = str_replace($mp3tip, " ", $iitip);
@@ -45,29 +45,29 @@ class Themelet {
if(strstr($h_tip, " ")){
$h_tip = html_escape(str_replace($justincase, "", $h_tip));
}else{
- $h_tip = html_escape($h_tip);
+ $h_tip = html_escape($h_tip);
}
}else{
- $h_tip = html_escape($image->get_tooltip());
+ $h_tip = html_escape($image->get_tooltip());
}
// If file is flash or svg then sets thumbnail to max size.
- if($image->ext == 'swf' || $image->ext == 'svg'){
+ if($image->ext === 'swf' || $image->ext === 'svg'){
$tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); }
else{
$tsize = get_thumbnail_size($image->width, $image->height); }
- return "
+ return '
-
-
-
-
+
- ";
+ ';
}
@@ -81,8 +81,8 @@ class Themelet {
}
private function gen_page_link($base_url, $query, $page, $name) {
- $link = make_link("$base_url/$page", $query);
- return "$name";
+ $link = make_link($base_url.'/'.$page, $query);
+ return '
'.$name.'';
}
private function gen_page_link_block($base_url, $query, $page, $current_page, $name) {
@@ -116,8 +116,8 @@ class Themelet {
}
$pages_html = implode(" | ", $pages);
- return "
$first_html | $prev_html | $random_html | $next_html | $last_html".
- "
<< $pages_html >>
";
+ return '
'.$first_html.' | '.$prev_html.' | '.$random_html.' | '.$next_html.' | '.$last_html
+ .'
<< '.$pages_html.' >>
';
}
}
?>