diff --git a/ext/view/theme.php b/ext/view/theme.php
index 2e24859d..27a8480e 100644
--- a/ext/view/theme.php
+++ b/ext/view/theme.php
@@ -65,7 +65,6 @@ class ViewImageTheme extends Themelet {
$owner = $image->get_owner();
$h_owner = html_escape($owner->name);
$h_ip = html_escape($image->owner_ip);
- $h_source = html_escape($image->source);
$i_owner_id = int_escape($owner->id);
$h_date = autodate($image->posted);
@@ -75,26 +74,30 @@ class ViewImageTheme extends Themelet {
if($user->can("view_ip")) {
$html .= " ($h_ip)";
}
- if(!is_null($image->source)) {
- if(substr($image->source, 0, 7) == "http://" || substr($image->source, 0, 8) == "https://") {
- $html .= " (source)";
- }
- else {
- $html .= " (source)";
- }
- }
+ $html .= $this->format_source($image->source);
$html .= $this->build_image_editor($image, $editor_parts);
return $html;
}
+ private function format_source($source) {
+ if(!is_null($source)) {
+ $h_source = html_escape($source);
+ if(startsWith($source, "http://") || startsWith($source, "https://")) {
+ return " (source)";
+ }
+ else {
+ return " (source)";
+ }
+ }
+ return "";
+ }
+
protected function build_image_editor(Image $image, $editor_parts) {
if(count($editor_parts) == 0) return ($image->is_locked() ? "
[Image Locked]" : "");
- $html = "
-