diff --git a/core/util.inc.php b/core/util.inc.php index 77c6c33e..5700463c 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -10,6 +10,7 @@ require_once "lib/context.php"; /** * Make some data safe for printing into HTML * + * @param $input * @return string */ function html_escape($input) { @@ -19,6 +20,7 @@ function html_escape($input) { /** * Make sure some data is safe to be used in integer context * + * @param $input * @return int */ function int_escape($input) { @@ -32,6 +34,7 @@ function int_escape($input) { /** * Make sure some data is safe to be used in URL context * + * @param $input * @return string */ function url_escape($input) { @@ -66,6 +69,7 @@ function url_escape($input) { /** * Make sure some data is safe to be used in SQL context * + * @param $input * @return string */ function sql_escape($input) { @@ -77,6 +81,7 @@ function sql_escape($input) { /** * Turn all manner of HTML / INI / JS / DB booleans into a PHP one * + * @param $input * @return boolean */ function bool_escape($input) { @@ -112,6 +117,7 @@ function bool_escape($input) { * Some functions require a callback function for escaping, * but we might not want to alter the data * + * @param $input * @return string */ function no_escape($input) { @@ -156,6 +162,7 @@ function truncate($string, $limit, $break=" ", $pad="...") { /** * Turn a human readable filesize into an integer, eg 1KB -> 1024 * + * @param $limit * @return int */ function parse_shorthand_int($limit) { @@ -185,6 +192,7 @@ function parse_shorthand_int($limit) { /** * Turn an integer into a human readable filesize, eg 1024 -> 1KB * + * @param $int * @return string */ function to_shorthand_int($int) { @@ -206,6 +214,8 @@ function to_shorthand_int($int) { /** * Turn a date into a time, a date, an "X minutes ago...", etc * + * @param $date + * @param bool $html * @return string */ function autodate($date, $html=true) { @@ -217,6 +227,7 @@ function autodate($date, $html=true) { /** * Check if a given string is a valid date-time. ( Format: yyyy-mm-dd hh:mm:ss ) * + * @param $dateTime * @return boolean */ function isValidDateTime($dateTime) { @@ -232,6 +243,7 @@ function isValidDateTime($dateTime) { /** * Check if a given string is a valid date. ( Format: yyyy-mm-dd ) * + * @param $date * @return boolean */ function isValidDate($date) { @@ -251,6 +263,8 @@ function isValidDate($date) { * * FIXME: also check that IP ban ext is installed * + * @param $ip + * @param $ban_reason * @return string */ function show_ip($ip, $ban_reason) { @@ -298,6 +312,8 @@ function endsWith(/*string*/ $haystack, /*string*/ $needle) { * * eg make_link("post/list") becomes "/v2/index.php?q=post/list" * + * @param null $page + * @param null $query * @return string */ function make_link($page=null, $query=null) { @@ -334,6 +350,7 @@ function make_link($page=null, $query=null) { /** * Take the current URL and modify some paramaters * + * @param $changes * @return string */ function modify_current_url($changes) { @@ -375,6 +392,7 @@ function modify_url($url, $changes) { /** * Turn a relative link into an absolute one, including hostname * + * @param $link * @return string */ function make_http(/*string*/ $link) { @@ -388,11 +406,11 @@ function make_http(/*string*/ $link) { /** * Make a form tag with relevant auth token and stuff * - * @param target string - * @param method string - * @param multipart boolean - * @param form_id string - * @param onsubmit string + * @param string $target + * @param string $method + * @param bool $multipart + * @param string $form_id + * @param string $onsubmit * * @return string */ @@ -508,16 +526,18 @@ function captcha_check() { \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** -* Get MIME type for file -* -* The contents of this function are taken from the __getMimeType() function -* from the "Amazon S3 PHP class" which is Copyright (c) 2008, Donovan Schönknecht -* and released under the 'Simplified BSD License'. -* -* @internal Used to get mime types -* @param string &$file File path -* @return string -*/ + * Get MIME type for file + * + * The contents of this function are taken from the __getMimeType() function + * from the "Amazon S3 PHP class" which is Copyright (c) 2008, Donovan Schönknecht + * and released under the 'Simplified BSD License'. + * + * @internal Used to get mime types + * @param string &$file File path + * @param string $ext + * @param bool $list + * @return string + */ function getMimeType($file, $ext="", $list=false) { // Static extension lookup @@ -642,6 +662,8 @@ function _count_execs($db, $sql, $inputarray) { /** * Compare two Block objects, used to sort them before being displayed * + * @param Block $a + * @param Block $b * @return int */ function blockcmp(Block $a, Block $b) { @@ -705,6 +727,7 @@ function get_memory_limit() { * Get the currently active IP, masked to make it not change when the last * octet or two change, for use in session cookies and such * + * @param Config $config * @return string */ function get_session_ip(Config $config) { @@ -791,6 +814,7 @@ function get_base_href() { * A shorthand way to send a TextFormattingEvent and get the * results * + * @param $string * @return string */ function format_text(/*string*/ $string) { @@ -1009,6 +1033,8 @@ function get_request_id() { /** * Remove an item from an array * + * @param $array + * @param $to_remove * @return array */ function array_remove($array, $to_remove) { @@ -1027,6 +1053,8 @@ function array_remove($array, $to_remove) { * * Also removes duplicate values from the array. * + * @param $array + * @param $element * @return array */ function array_add($array, $element) { @@ -1040,6 +1068,7 @@ function array_add($array, $element) { /** * Return the unique elements of an array, case insensitively * + * @param $array * @return array */ function array_iunique($array) { @@ -1063,6 +1092,8 @@ function array_iunique($array) { * * from http://uk.php.net/network * + * @param $IP + * @param $CIDR * @return bool */ function ip_in_range($IP, $CIDR) { @@ -1123,7 +1154,7 @@ function deltree($f) { } /** - * Copy an entire file heirachy + * Copy an entire file hierarchy * * from a comment on http://uk.php.net/copy */