diff --git a/core/util.inc.php b/core/util.inc.php index 105961da..287e0f71 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -950,21 +950,19 @@ function transload($url, $mfile) { } if($config->get_string("transload_engine") === "fopen") { - $fp = @fopen($url, "r"); - if(!$fp) { + $fp_in = @fopen($url, "r"); + $fp_out = fopen($mfile, "w"); + if(!$fp_in || !$fp_out) { return false; } - $data = ""; $length = 0; - while(!feof($fp) && $length <= $config->get_int('upload_size')) { - $data .= fread($fp, 8192); - $length = strlen($data); + while(!feof($fp_in) && $length <= $config->get_int('upload_size')) { + $data = fread($fp_in, 8192); + $length += strlen($data); + fwrite($fp_out, $data); } - fclose($fp); - - $fp = fopen($mfile, "w"); - fwrite($fp, $data); - fclose($fp); + fclose($fp_in); + fclose($fp_out); $headers = http_parse_headers(implode("\n", $http_response_header)); diff --git a/ext/danbooru_api/main.php b/ext/danbooru_api/main.php index cf356552..3bbad680 100644 --- a/ext/danbooru_api/main.php +++ b/ext/danbooru_api/main.php @@ -321,44 +321,15 @@ class DanbooruApi extends Extension { $source = null; } } elseif (isset($_REQUEST['source']) || isset($_REQUEST['post']['source'])) { // A url was provided - $url = isset($_REQUEST['source']) ? $_REQUEST['source'] : $_REQUEST['post']['source']; - $source = $url; - $tmp_filename = tempnam("/tmp", "shimmie_transload"); - - // Are we using fopen wrappers or curl? - if ($config->get_string("transload_engine") == "fopen") { - $fp = fopen($url, "r"); - if (!$fp) { - $page->set_code(409); - $page->add_http_header("X-Danbooru-Errors: fopen read error"); - } - - $data = ""; - $length = 0; - while (!feof($fp) && $length <= $config->get_int('upload_size')) { - $data .= fread($fp, 8192); - $length = strlen($data); - } - fclose($fp); - - $fp = fopen($tmp_filename, "w"); - fwrite($fp, $data); - fclose($fp); + $source = isset($_REQUEST['source']) ? $_REQUEST['source'] : $_REQUEST['post']['source']; + $file = tempnam("/tmp", "shimmie_transload"); + $ok = transload($source, $file); + if (!$ok) { + $page->set_code(409); + $page->add_http_header("X-Danbooru-Errors: fopen read error"); + return; } - - if ($config->get_string("transload_engine") == "curl") { - $ch = curl_init($url); - $fp = fopen($tmp_filename, "w"); - - curl_setopt($ch, CURLOPT_FILE, $fp); - curl_setopt($ch, CURLOPT_HEADER, 0); - - curl_exec($ch); - curl_close($ch); - fclose($fp); - } - $file = $tmp_filename; - $filename = basename($url); + $filename = basename($source); } else { // Nothing was specified at all $page->set_code(409); $page->add_http_header("X-Danbooru-Errors: no input files"); @@ -367,8 +338,9 @@ class DanbooruApi extends Extension { // Get tags out of url $posttags = Tag::explode(isset($_REQUEST['tags']) ? $_REQUEST['tags'] : $_REQUEST['post']['tags']); - $hash = md5_file($file); + // Was an md5 supplied? Does it match the file hash? + $hash = md5_file($file); if (isset($_REQUEST['md5']) && strtolower($_REQUEST['md5']) != $hash) { $page->set_code(409); $page->add_http_header("X-Danbooru-Errors: md5 mismatch"); diff --git a/ext/ext_manager/main.php b/ext/ext_manager/main.php index 8941a528..ee465965 100644 --- a/ext/ext_manager/main.php +++ b/ext/ext_manager/main.php @@ -23,7 +23,7 @@ class ExtensionInfo { var $description, $documentation, $version, $visibility; var $enabled; - function __construct($main) { + public function __construct($main) { $matches = array(); $lines = file($main); $number_of_lines = count($lines); @@ -156,7 +156,7 @@ class ExtManager extends Extension { /** * @param bool $all - * @return array + * @return ExtensionInfo[] */ private function get_extensions(/*bool*/ $all) { $extensions = array(); diff --git a/ext/favorites/main.php b/ext/favorites/main.php index 0cfca51b..8e6af251 100644 --- a/ext/favorites/main.php +++ b/ext/favorites/main.php @@ -204,7 +204,7 @@ class Favorites extends Extension { /** * @param Image $image - * @return array + * @return string[] */ private function list_persons_who_have_favorited(Image $image) { global $database; diff --git a/ext/handle_archive/main.php b/ext/handle_archive/main.php index ba2fd59c..1fe56ca6 100644 --- a/ext/handle_archive/main.php +++ b/ext/handle_archive/main.php @@ -44,7 +44,7 @@ class ArchiveFileHandler extends Extension { } /** - * @param $ext + * @param string $ext * @return bool */ private function supported_ext($ext) { diff --git a/ext/handle_flash/main.php b/ext/handle_flash/main.php index 58d93a3f..9b8eda6c 100644 --- a/ext/handle_flash/main.php +++ b/ext/handle_flash/main.php @@ -50,7 +50,7 @@ class FlashFileHandler extends DataHandlerExtension { } /** - * @param $file + * @param string $file * @return bool */ protected function check_contents(/*string*/ $file) { diff --git a/ext/handle_ico/main.php b/ext/handle_ico/main.php index 185bd7f3..c16fb64e 100644 --- a/ext/handle_ico/main.php +++ b/ext/handle_ico/main.php @@ -50,7 +50,7 @@ class IcoFileHandler extends Extension { } /** - * @param $ext + * @param string $ext * @return bool */ private function supported_ext($ext) { @@ -59,8 +59,8 @@ class IcoFileHandler extends Extension { } /** - * @param $filename - * @param $metadata + * @param string $filename + * @param mixed[] $metadata * @return Image */ private function create_image_from_data($filename, $metadata) { diff --git a/ext/handle_mp3/main.php b/ext/handle_mp3/main.php index 691fc644..069107b5 100644 --- a/ext/handle_mp3/main.php +++ b/ext/handle_mp3/main.php @@ -26,7 +26,7 @@ class MP3FileHandler extends DataHandlerExtension { /** * @param string $filename - * @param array $metadata + * @param mixed[] $metadata * @return Image|null */ protected function create_image_from_data($filename, $metadata) { diff --git a/ext/handle_pixel/main.php b/ext/handle_pixel/main.php index bacc8804..e216568a 100644 --- a/ext/handle_pixel/main.php +++ b/ext/handle_pixel/main.php @@ -67,7 +67,7 @@ class PixelFileHandler extends DataHandlerExtension { } /** - * @param $hash + * @param string $hash * @return bool */ protected function create_thumb_force(/*string*/ $hash) { @@ -91,9 +91,6 @@ class PixelFileHandler extends DataHandlerExtension { return $ok; } - /** - * @param ImageAdminBlockBuildingEvent $event - */ public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) { $event->add_part("
diff --git a/ext/handle_svg/main.php b/ext/handle_svg/main.php index 96640595..e4f2f9fe 100644 --- a/ext/handle_svg/main.php +++ b/ext/handle_svg/main.php @@ -51,7 +51,7 @@ class SVGFileHandler extends Extension { } /** - * @param $ext + * @param string $ext * @return bool */ private function supported_ext($ext) { @@ -60,8 +60,8 @@ class SVGFileHandler extends Extension { } /** - * @param $filename - * @param $metadata + * @param string $filename + * @param mixed[] $metadata * @return Image */ private function create_image_from_data($filename, $metadata) { @@ -82,7 +82,7 @@ class SVGFileHandler extends Extension { } /** - * @param $file + * @param string $file * @return bool */ private function check_contents($file) { diff --git a/ext/handle_video/main.php b/ext/handle_video/main.php index 4a253d5b..b6930177 100644 --- a/ext/handle_video/main.php +++ b/ext/handle_video/main.php @@ -118,7 +118,7 @@ class VideoFileHandler extends DataHandlerExtension { /** * @param string $filename - * @param array $metadata + * @param mixed[] $metadata * @return Image|null */ protected function create_image_from_data($filename, $metadata) { @@ -162,7 +162,7 @@ class VideoFileHandler extends DataHandlerExtension { } /** - * @param $file + * @param string $file * @return bool */ protected function check_contents($file) { diff --git a/ext/image/main.php b/ext/image/main.php index 3eddd7b2..71c829a2 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -32,6 +32,9 @@ class ImageAdditionEvent extends Event { class ImageAdditionException extends SCoreException { var $error; + /** + * @param string $error + */ public function __construct($error) { $this->error = $error; } diff --git a/ext/image_hash_ban/main.php b/ext/image_hash_ban/main.php index 742e8a85..07a36174 100644 --- a/ext/image_hash_ban/main.php +++ b/ext/image_hash_ban/main.php @@ -13,6 +13,9 @@ class RemoveImageHashBanEvent extends Event { var $hash; + /** + * @param string $hash + */ public function __construct($hash) { $this->hash = $hash; } @@ -23,6 +26,10 @@ class AddImageHashBanEvent extends Event { var $hash; var $reason; + /** + * @param string $hash + * @param string $reason + */ public function __construct($hash, $reason) { $this->hash = $hash; $this->reason = $reason; @@ -126,6 +133,11 @@ class ImageBan extends Extension { // DB funness + /** + * @param int $page + * @param int $size + * @return array + */ public function get_image_hash_bans($page, $size=100) { global $database; diff --git a/ext/index/theme.php b/ext/index/theme.php index 1cacd4e2..dbe21094 100644 --- a/ext/index/theme.php +++ b/ext/index/theme.php @@ -3,6 +3,11 @@ class IndexTheme extends Themelet { var $page_number, $total_pages, $search_terms; + /** + * @param int $page_number + * @param int $total_pages + * @param string[] $search_terms + */ public function set_page($page_number, $total_pages, $search_terms) { $this->page_number = $page_number; $this->total_pages = $total_pages; @@ -27,6 +32,10 @@ and of course start organising your images :-) $page->add_block(new Block("Installation Succeeded!", $text, "main", 0)); } + /** + * @param Page $page + * @param Image[] $images + */ public function display_page(Page $page, $images) { $this->display_page_header($page, $images); @@ -41,12 +50,21 @@ and of course start organising your images :-) } } - public function display_admin_block(/*array(string)*/ $parts) { + /** + * @param string[] $parts + */ + public function display_admin_block($parts) { global $page; $page->add_block(new Block("List Controls", join("
", $parts), "left", 50)); } + /** + * @param int $page_number + * @param int $total_pages + * @param string[] $search_terms + * @return string + */ protected function build_navigation($page_number, $total_pages, $search_terms) { $prev = $page_number - 1; $next = $page_number + 1; @@ -72,6 +90,11 @@ and of course start organising your images :-) return $h_prev.' | '.$h_index.' | '.$h_next.'
'.$h_search; } + /** + * @param Image[] $images + * @param string $query + * @return string + */ protected function build_table($images, $query) { $h_query = html_escape($query); $table = "
"; @@ -82,6 +105,10 @@ and of course start organising your images :-) return $table; } + /** + * @param Page $page + * @param Image[] $images + */ protected function display_page_header(Page $page, $images) { global $config; @@ -102,6 +129,10 @@ and of course start organising your images :-) $page->set_heading($page_title); } + /** + * @param Page $page + * @param Image[] $images + */ protected function display_page_images(Page $page, $images) { if (count($this->search_terms) > 0) { $query = url_escape(implode(' ', $this->search_terms)); diff --git a/ext/mass_tagger/main.php b/ext/mass_tagger/main.php index d65b8a46..a1806d21 100644 --- a/ext/mass_tagger/main.php +++ b/ext/mass_tagger/main.php @@ -16,62 +16,54 @@ class MassTagger extends Extension { public function onPostListBuilding(PostListBuildingEvent $event) { global $config, $page, $user; - if( !$user->is_admin() ) return; - - $this->theme->display_mass_tagger( $page, $event, $config ); + if($user->is_admin()) { + $this->theme->display_mass_tagger( $page, $event, $config ); + } } public function onPageRequest(PageRequestEvent $event) { - global $config, $page, $user; - if( !$event->page_matches("mass_tagger") ) return; - if( !$user->is_admin() ) return; - - if($event->get_arg(0) == "tag") $this->_apply_mass_tags( $config, $page, $user, $event ); - } - - private function _apply_mass_tags( $config, Page $page, $user, $event ) { - if( !isset($_POST['ids']) or !isset($_POST['tag']) ) return; - - $tag = $_POST['tag']; - - $tag_array = explode(" ",$tag); - $pos_tag_array = array(); - $neg_tag_array = array(); - foreach($tag_array as $new_tag) { - if (strpos($new_tag, '-') === 0) - $neg_tag_array[] = substr($new_tag,1); - else - $pos_tag_array[] = $new_tag; - } - - $ids = explode( ':', $_POST['ids'] ); - $ids = array_filter ( $ids , 'is_numeric' ); - - $images = array_map( "Image::by_id", $ids ); - - if(isset($_POST['setadd']) && - $_POST['setadd'] == 'set') - { - foreach($images as $image) { - $image->set_tags(Tag::explode($tag)); - } - } - else - { - foreach($images as $image) { - if (!empty($neg_tag_array)) { - $img_tags = array_merge($pos_tag_array, explode(" ",$image->get_tag_list())); - $img_tags = array_diff($img_tags, $neg_tag_array); - $image->set_tags(Tag::explode($img_tags)); - } + global $page, $user; + if($event->page_matches("mass_tagger/tag") && $user->is_admin()) { + if( !isset($_POST['ids']) or !isset($_POST['tag']) ) return; + + $tag = $_POST['tag']; + + $tag_array = explode(" ",$tag); + $pos_tag_array = array(); + $neg_tag_array = array(); + foreach($tag_array as $new_tag) { + if (strpos($new_tag, '-') === 0) + $neg_tag_array[] = substr($new_tag,1); else - $image->set_tags(Tag::explode($tag . " " . $image->get_tag_list())); + $pos_tag_array[] = $new_tag; } + + $ids = explode( ':', $_POST['ids'] ); + $ids = array_filter ( $ids , 'is_numeric' ); + + $images = array_map( "Image::by_id", $ids ); + + if(isset($_POST['setadd']) && $_POST['setadd'] == 'set') { + foreach($images as $image) { + $image->set_tags(Tag::explode($tag)); + } + } + else { + foreach($images as $image) { + if (!empty($neg_tag_array)) { + $img_tags = array_merge($pos_tag_array, explode(" ",$image->get_tag_list())); + $img_tags = array_diff($img_tags, $neg_tag_array); + $image->set_tags(Tag::explode($img_tags)); + } + else + $image->set_tags(Tag::explode($tag . " " . $image->get_tag_list())); + } + } + + $page->set_mode("redirect"); + if(!isset($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = make_link(); + $page->set_redirect($_SERVER['HTTP_REFERER']); } - - $page->set_mode("redirect"); - if(!isset($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = make_link(); - $page->set_redirect($_SERVER['HTTP_REFERER']); } } diff --git a/ext/not_a_tag/main.php b/ext/not_a_tag/main.php index 777d6dbe..29f4f502 100644 --- a/ext/not_a_tag/main.php +++ b/ext/not_a_tag/main.php @@ -28,7 +28,10 @@ class NotATag extends Extension { $this->scan($event->tags); } - private function scan(/*array*/ $tags_mixed) { + /** + * @param string[] $tags_mixed + */ + private function scan($tags_mixed) { global $database; $tags = array(); @@ -90,6 +93,11 @@ class NotATag extends Extension { } } + /** + * @param int $page + * @param int $size + * @return array + */ public function get_untags($page, $size=100) { global $database; diff --git a/ext/numeric_score/main.php b/ext/numeric_score/main.php index 5954afd5..7a3d63e8 100644 --- a/ext/numeric_score/main.php +++ b/ext/numeric_score/main.php @@ -13,7 +13,12 @@ class NumericScoreSetEvent extends Event { var $image_id, $user, $score; - public function __construct(/*int*/ $image_id, User $user, /*int*/ $score) { + /** + * @param int $image_id + * @param User $user + * @param int $score + */ + public function __construct($image_id, User $user, $score) { $this->image_id = $image_id; $this->user = $user; $this->score = $score; @@ -168,7 +173,10 @@ class NumericScore extends Extension { $this->delete_votes_by($event->id); } - public function delete_votes_by(/*int*/ $user_id) { + /** + * @param int $user_id + */ + public function delete_votes_by($user_id) { global $database; $image_ids = $database->get_col("SELECT image_id FROM numeric_score_votes WHERE user_id=?", array($user_id)); @@ -290,7 +298,7 @@ class NumericScore extends Extension { * @param int $user_id * @param int $score */ - private function add_vote(/*int*/ $image_id, /*int*/ $user_id, /*int*/ $score) { + private function add_vote($image_id, $user_id, $score) { global $database; $database->execute( "DELETE FROM numeric_score_votes WHERE image_id=:imageid AND user_id=:userid", diff --git a/ext/pools/main.php b/ext/pools/main.php index a47e441f..4788de9e 100644 --- a/ext/pools/main.php +++ b/ext/pools/main.php @@ -260,13 +260,13 @@ class Pools extends Extension { if($config->get_bool("poolsInfoOnViewImage")) { $imageID = $event->image->id; - $poolsIDs = $this->get_pool_id($imageID); + $poolsIDs = $this->get_pool_ids($imageID); $show_nav = $config->get_bool("poolsShowNavLinks", false); $navInfo = array(); foreach($poolsIDs as $poolID) { - $pool = $this->get_single_pool($poolID['pool_id']); + $pool = $this->get_single_pool($poolID); $navInfo[$pool['id']] = array(); $navInfo[$pool['id']]['info'] = $pool; @@ -411,7 +411,7 @@ class Pools extends Extension { /** * HERE WE CREATE A NEW POOL * - * @return mixed + * @return int * @throws PoolCreationException */ private function add_pool() { @@ -433,12 +433,9 @@ class Pools extends Extension { VALUES (:uid, :public, :title, :desc, now())", array("uid"=>$user->id, "public"=>$public, "title"=>$_POST["title"], "desc"=>$_POST["description"])); - $result = array(); - $result['poolID'] = $database->get_last_insert_id('pools_id_seq'); - - log_info("pools", "Pool {$result["poolID"]} created by {$user->name}"); - - return $result["poolID"]; + $poolID = $database->get_last_insert_id('pools_id_seq'); + log_info("pools", "Pool {$poolID} created by {$user->name}"); + return $poolID; } /** @@ -477,11 +474,11 @@ class Pools extends Extension { /** * Get all of the pool IDs that an image is in, given an image ID. * @param int $imageID Integer ID for the image - * @return array + * @return int[] */ - private function get_pool_id(/*int*/ $imageID) { + private function get_pool_ids(/*int*/ $imageID) { global $database; - return $database->get_all("SELECT pool_id FROM pool_images WHERE image_id=:iid", array("iid"=>$imageID)); + return $database->get_col("SELECT pool_id FROM pool_images WHERE image_id=:iid", array("iid"=>$imageID)); } /** diff --git a/ext/report_image/main.php b/ext/report_image/main.php index ee6a84ae..c64b1e63 100644 --- a/ext/report_image/main.php +++ b/ext/report_image/main.php @@ -141,7 +141,10 @@ class ReportImage extends Extension { $this->delete_reports_by($event->id); } - public function delete_reports_by(/*int*/ $user_id) { + /** + * @param int $user_id + */ + public function delete_reports_by($user_id) { global $database; $database->execute("DELETE FROM image_reports WHERE reporter_id=?", array($user_id)); $database->cache->delete("image-report-count"); @@ -165,7 +168,7 @@ class ReportImage extends Extension { /** * @param Image $image - * @return array + * @return string[] */ public function get_reporters(Image $image) { global $database; @@ -206,7 +209,7 @@ class ReportImage extends Extension { } /** - * @return mixed + * @return int */ public function count_reported_images() { global $database; @@ -220,13 +223,3 @@ class ReportImage extends Extension { return $count; } } -// ===== Changelog ===== -// * Version 0.3a / 0.3a_rc - 11/06/07 - I can no longer use the same theme.php file for both SVN and RCx. Sorry. -// * Same deal with theme.php as it is with main.php -// * Version 0.3 / 0.3_rc - 11/06/07 - Added the option to display thumbnails, moved the reported image list to it's -// own page, and checked to make sure the user is an admin before letting them delete / view reported images. -// * Version 0.2c_rc2 - 10/27/07 - Now (really!) supports Shimmie2 RC2! -// * Version 0.2b - 10/27/07 - Now supports Shimmie2 RC2! -// * Version 0.2a - 10/24/07 - Fixed some SQL issues. I will make sure to test before commiting :) -// * Version 0.2 - 10/24/07 - First public release. - diff --git a/ext/resize/main.php b/ext/resize/main.php index 2f2cdb43..02d7bf96 100644 --- a/ext/resize/main.php +++ b/ext/resize/main.php @@ -291,7 +291,7 @@ class ResizeImage extends Extension { * http://stackoverflow.com/questions/527532/reasonable-php-memory-limit-for-image-resize * * @param $info - * @return array + * @return int */ private function calc_memory_use($info) { if (isset($info['bits']) && isset($info['channels'])) { @@ -308,7 +308,7 @@ class ResizeImage extends Extension { * @param Image $image_obj * @param $width * @param $height - * @return array + * @return int[] */ private function calc_new_size(Image $image_obj, $width, $height) { /* Calculate the new size of the image */ diff --git a/ext/shimmie_api/main.php b/ext/shimmie_api/main.php index b2e6db2d..4c455f56 100644 --- a/ext/shimmie_api/main.php +++ b/ext/shimmie_api/main.php @@ -113,7 +113,7 @@ class ShimmieApi extends Extension { /** * @param string $arg - * @return array + * @return string[] */ private function api_get_tags($arg) { global $database; diff --git a/ext/upload/main.php b/ext/upload/main.php index 27862703..9c7b3fa0 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -234,8 +234,8 @@ class Upload extends Extension { } /** - * @param string|int $id - * @return array + * @param int $id + * @return string[] */ private function tags_for_upload_slot($id) { if(isset($_POST["tags$id"])) { diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index c8026b5d..b2badbb1 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -30,7 +30,7 @@ class Themelet extends BaseThemelet { * @param string $base_url * @param string $query * @param int|string $page - * @param int|string $current_page + * @param int $current_page * @param string $name * @return string */ diff --git a/themes/danbooru2/index.theme.php b/themes/danbooru2/index.theme.php index 090cd248..3f462887 100644 --- a/themes/danbooru2/index.theme.php +++ b/themes/danbooru2/index.theme.php @@ -1,6 +1,10 @@ "; diff --git a/themes/danbooru2/layout.class.php b/themes/danbooru2/layout.class.php index ac8bfa13..4f459893 100644 --- a/themes/danbooru2/layout.class.php +++ b/themes/danbooru2/layout.class.php @@ -264,12 +264,18 @@ $header_html EOD; } - + + /** + * @param string $link + * @param string $desc + * @param string[] $pages_matched + * @return string + */ private function navlinks($link, $desc, $pages_matched) { /** * Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.) */ - $html = null; + $html = ""; $url = _get_query(); $re1='.*?'; @@ -286,7 +292,7 @@ EOD; $html = "
  • $desc
  • "; } } - if(is_null($html)) {$html = "
  • $desc
  • ";} + if(empty($html)) {$html = "
  • $desc
  • ";} return $html; } } diff --git a/themes/danbooru2/themelet.class.php b/themes/danbooru2/themelet.class.php index c8026b5d..b2badbb1 100644 --- a/themes/danbooru2/themelet.class.php +++ b/themes/danbooru2/themelet.class.php @@ -30,7 +30,7 @@ class Themelet extends BaseThemelet { * @param string $base_url * @param string $query * @param int|string $page - * @param int|string $current_page + * @param int $current_page * @param string $name * @return string */ diff --git a/themes/lite/view.theme.php b/themes/lite/view.theme.php index b2848072..b1083d0b 100644 --- a/themes/lite/view.theme.php +++ b/themes/lite/view.theme.php @@ -16,7 +16,11 @@ class CustomViewImageTheme extends ViewImageTheme { $page->add_block(new Block(null, $this->build_info($image, $editor_parts), "main", 11)); $page->add_block(new Block(null, $this->build_pin($image), "main", 11)); } - + + /** + * @param Image $image + * @return string + */ private function build_stats(Image $image) { $h_owner = html_escape($image->get_owner()->name); $h_ownerlink = "$h_owner";