diff --git a/plugins/calendar/autoinstall.php b/plugins/calendar/autoinstall.php index e9ca59137..afc9401f6 100644 --- a/plugins/calendar/autoinstall.php +++ b/plugins/calendar/autoinstall.php @@ -30,10 +30,12 @@ // +---------------------------------------------------------------------------+ /** -* Calendar plugin automatic plugin install -* -* @package Calendar -*/ + * Calendar plugin automatic plugin install + * + * @package Calendar + * @param string $pi_name + * @return array + */ function plugin_autoinstall_calendar($pi_name) { @@ -151,5 +153,3 @@ function plugin_compatible_with_this_version_calendar($pi_name) return true; } - -?> diff --git a/plugins/calendar/functions.inc b/plugins/calendar/functions.inc index efa5d12c0..2fceca7d5 100644 --- a/plugins/calendar/functions.inc +++ b/plugins/calendar/functions.inc @@ -578,13 +578,13 @@ function plugin_savesubmission_calendar($A) $A['end_minute'] = COM_applyFilter($A['end_minute'], true); if ($A['start_ampm'] == 'pm' && $A['start_hour'] != 12) { - $A['start_hour'] = $A['start_hour'] + 12; + $A['start_hour'] = (int) $A['start_hour'] + 12; } if ($A['start_ampm'] == 'am' && $A['start_hour'] == 12) { $A['start_hour'] = '00'; } if ($A['end_ampm'] == 'pm' && $A['end_hour'] != 12) { - $A['end_hour'] = $A['end_hour'] + 12; + $A['end_hour'] = (int) $A['end_hour'] + 12; } if ($A['end_ampm'] == 'am' && $A['end_hour'] == 12) { $A['end_hour'] = '00'; @@ -1133,8 +1133,13 @@ function plugin_submissioncount_calendar() /** * Implements the [event:] autotag. + * + * @param string $op + * @param string $content + * @param array $autotag + * @return array|string */ -function plugin_autotags_calendar($op, $content = '', $autotag = '') +function plugin_autotags_calendar($op, $content = '', $autotag = array()) { global $_CONF, $_TABLES, $LANG_CAL_1, $_CA_CONF, $_GROUPS; @@ -1211,6 +1216,8 @@ function plugin_getfeednames_calendar() * @param string $feed feed ID * @param string $link link to homepage * @param string $update list of story ids + * @param string $feedType + * @param int $feedVersion * @return array content of the feed */ function plugin_getfeedcontent_calendar($feed, &$link, &$update, $feedType, $feedVersion) @@ -2310,7 +2317,8 @@ function plugin_itemdeleted_calendar($id, $type) /** * Did user create any events * - * @return string number of events user contributed. If nothing leave blank + * @param int $uid + * @return string number of events user contributed. If nothing leave blank */ function plugin_usercontributed_calendar($uid) { diff --git a/plugins/calendar/install_defaults.php b/plugins/calendar/install_defaults.php index bb4878e75..d158f09f9 100644 --- a/plugins/calendar/install_defaults.php +++ b/plugins/calendar/install_defaults.php @@ -223,5 +223,3 @@ function plugin_initconfig_calendar() return true; } - -?> diff --git a/plugins/calendar/install_updates.php b/plugins/calendar/install_updates.php index d9c355eb1..732fd0458 100644 --- a/plugins/calendar/install_updates.php +++ b/plugins/calendar/install_updates.php @@ -68,5 +68,3 @@ function calendar_update_ConfValues_1_1_2() return true; } - -?> \ No newline at end of file diff --git a/plugins/calendar/language/english.php b/plugins/calendar/language/english.php index 1dbf5fb5e..75e525547 100644 --- a/plugins/calendar/language/english.php +++ b/plugins/calendar/language/english.php @@ -252,5 +252,3 @@ 14 => array('No access' => 0, 'Read-Only' => 2), 15 => array('All' => TOPIC_ALL_OPTION, 'Homepage Only' => TOPIC_HOMEONLY_OPTION, 'Select Topics' => TOPIC_SELECTED_OPTION) ); - -?> diff --git a/plugins/calendar/language/english_utf-8.php b/plugins/calendar/language/english_utf-8.php index 47469ad09..323325eb3 100644 --- a/plugins/calendar/language/english_utf-8.php +++ b/plugins/calendar/language/english_utf-8.php @@ -252,5 +252,3 @@ 14 => array('No access' => 0, 'Read-Only' => 2), 15 => array('All' => TOPIC_ALL_OPTION, 'Homepage Only' => TOPIC_HOMEONLY_OPTION, 'Select Topics' => TOPIC_SELECTED_OPTION) ); - -?> diff --git a/plugins/calendar/sql/mysql_install.php b/plugins/calendar/sql/mysql_install.php index 362bf6e40..21734ef82 100644 --- a/plugins/calendar/sql/mysql_install.php +++ b/plugins/calendar/sql/mysql_install.php @@ -118,5 +118,3 @@ "; $_SQL[] = "INSERT INTO {$_TABLES['eventsubmission']} (eid, title, description, location, datestart, dateend, url, allday, zipcode, state, city, address2, address1, event_type, timestart, timeend, owner_id) VALUES ('2008050110130162','Installed the Calendar plugin','Today, you successfully installed the Calendar plugin.','Your webserver',CURDATE(),CURDATE(),'https://www.geeklog.net/',1,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,1)"; - -?> diff --git a/plugins/calendar/sql/mysql_updates.php b/plugins/calendar/sql/mysql_updates.php index bf21fa0d2..2bcd2b362 100644 --- a/plugins/calendar/sql/mysql_updates.php +++ b/plugins/calendar/sql/mysql_updates.php @@ -140,5 +140,3 @@ function calendar_update_Zipcode_1_1_2() { // Nothing to do } - -?> diff --git a/plugins/calendar/sql/pgsql_install.php b/plugins/calendar/sql/pgsql_install.php index ea3f81af8..c3cb1d540 100644 --- a/plugins/calendar/sql/pgsql_install.php +++ b/plugins/calendar/sql/pgsql_install.php @@ -118,5 +118,3 @@ "; $_SQL[] = "INSERT INTO {$_TABLES['eventsubmission']} (eid, title, description, location, datestart, dateend, url, allday, zipcode, state, city, address2, address1, event_type, timestart, timeend) VALUES ('2008050110130162','Installed the Calendar plugin','Today, you successfully installed the Calendar plugin.','Your webserver',CURDATE(),CURDATE(),'https://www.geeklog.net/',1,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL)"; - -?> diff --git a/plugins/calendar/sql/pgsql_updates.php b/plugins/calendar/sql/pgsql_updates.php index 25af4d748..fc5a9ca78 100644 --- a/plugins/calendar/sql/pgsql_updates.php +++ b/plugins/calendar/sql/pgsql_updates.php @@ -126,5 +126,3 @@ function calendar_update_Zipcode_1_1_2() DB_query($sql); } } - -?> diff --git a/plugins/links/autoinstall.php b/plugins/links/autoinstall.php index 65c0e1efb..56a1bf50f 100644 --- a/plugins/links/autoinstall.php +++ b/plugins/links/autoinstall.php @@ -120,14 +120,14 @@ function plugin_load_configuration_links($pi_name) } /** -* Plugin postinstall -* -* We're inserting our default data here since it depends on other stuff that -* has to happen first ... -* -* @return boolean true = proceed with install, false = an error occurred -* -*/ + * Plugin postinstall + * + * We're inserting our default data here since it depends on other stuff that + * has to happen first ... + * + * @param string $pi_name + * @return bool true = proceed with install, false = an error occurred + */ function plugin_postinstall_links($pi_name) { global $_CONF, $_TABLES; @@ -204,5 +204,3 @@ function plugin_compatible_with_this_version_links($pi_name) return true; } - -?> diff --git a/plugins/links/configuration_validation.php b/plugins/links/configuration_validation.php index 63a67c68e..b94c39367 100644 --- a/plugins/links/configuration_validation.php +++ b/plugins/links/configuration_validation.php @@ -95,5 +95,3 @@ $_CONF_VALIDATE['links']['autotag_permissions_link[3]'] = array( 'rule' => array('inList', array(0, 2), true) ); - -?> diff --git a/plugins/links/functions.inc b/plugins/links/functions.inc index 276490edb..5b243db79 100644 --- a/plugins/links/functions.inc +++ b/plugins/links/functions.inc @@ -185,10 +185,9 @@ function plugin_getwhatsnew_links() * @param string $op operation to perform * @param string $content item (e.g. story text), including the autotag * @param array $autotag parameters used in the autotag -* @param mixed tag names (for $op='tagname') or formatted content -* +* @return string|array */ -function plugin_autotags_links($op, $content = '', $autotag = '') +function plugin_autotags_links($op, $content = '', $autotag = array()) { global $_CONF, $_TABLES, $LANG_DIRECTION, $LANG_LINKS, $_LI_CONF, $_GROUPS; @@ -301,11 +300,9 @@ function LINKS_countLinksAndClicks() * If $showsitestats is 1 then we are to only print the overall stats in the * 'site statistics box' otherwise we show the detailed stats * -* @param int $showsitestate Flag to let us know which stats to get -* @param string HTML for the stats section -* +* @return string */ -function plugin_showstats_links ($showsitestats) +function plugin_showstats_links () { global $_CONF, $_TABLES, $LANG_LINKS_STATS; @@ -838,8 +835,7 @@ function plugin_upgrade_links() * Called during site migration - handle changed URLs or paths * * @param array $old_conf contents of the $_CONF array on the old site -* @param boolean true on success, otherwise false -* +* @return bool true on success, otherwise false */ function plugin_migrate_links($old_conf) { @@ -1152,9 +1148,10 @@ function plugin_save_submit_links($A) } if (($_LI_CONF['linksubmission'] == 1) && !SEC_hasRights('links.submit')) { - $result = DB_save($_TABLES['linksubmission'], - 'lid,cid,url,description,title,date,owner_id', - "{$A['lid']},'{$A['cid']}','{$A['url']}','{$A['description']}','{$A['title']}',NOW(),$owner_id"); + DB_save( + $_TABLES['linksubmission'], 'lid,cid,url,description,title,date,owner_id', + "{$A['lid']},'{$A['cid']}','{$A['url']}','{$A['description']}','{$A['title']}',NOW(),$owner_id" + ); if ($_LI_CONF['notification'] == 1) { LINKS_sendNotification($_TABLES['linksubmission'], $A); @@ -1170,9 +1167,10 @@ function plugin_save_submit_links($A) } SEC_setDefaultPermissions($A, $_LI_CONF['default_permissions']); - $result = DB_save($_TABLES['links'], - 'lid,cid,url,description,title,date,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon', - "{$A['lid']},'{$A['cid']}','{$A['url']}','{$A['description']}','{$A['title']}',NOW(),$owner_id,{$A['group_id']},{$A['perm_owner']},{$A['perm_group']},{$A['perm_members']},{$A['perm_anon']}"); + DB_save( + $_TABLES['links'], 'lid,cid,url,description,title,date,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon', + "{$A['lid']},'{$A['cid']}','{$A['url']}','{$A['description']}','{$A['title']}',NOW(),$owner_id,{$A['group_id']},{$A['perm_owner']},{$A['perm_group']},{$A['perm_members']},{$A['perm_anon']}" + ); PLG_itemSaved($A['lid'], 'links'); @@ -1354,10 +1352,9 @@ function links_validateUrl($url) { global $LANG_LINKS_STATUS; - $req = new HTTP_Request2($url, HTTP_Request2::METHOD_HEAD); - $req->setHeader('User-Agent', 'Geeklog/' . VERSION); - try { + $req = new HTTP_Request2($url, HTTP_Request2::METHOD_HEAD); + $req->setHeader('User-Agent', 'Geeklog/' . VERSION); $response = $req->send(); $status_code = $response->getStatus(); @@ -1917,7 +1914,8 @@ function plugin_group_changed_links($grp_id, $mode) /** * Did user create any links * - * @return string number of links user contributed. If nothing leave blank + * @param int $uid + * @return string number of links user contributed. If nothing leave blank */ function plugin_usercontributed_links($uid) { diff --git a/plugins/links/install_defaults.php b/plugins/links/install_defaults.php index a5da5c13d..75412f98a 100644 --- a/plugins/links/install_defaults.php +++ b/plugins/links/install_defaults.php @@ -254,5 +254,3 @@ function plugin_initconfig_links() return true; } - -?> diff --git a/plugins/links/install_updates.php b/plugins/links/install_updates.php index 9e700d739..3b1939fb4 100644 --- a/plugins/links/install_updates.php +++ b/plugins/links/install_updates.php @@ -25,5 +25,3 @@ function links_update_ConfValues_2_1_0() return true; } - -?> \ No newline at end of file diff --git a/plugins/links/language/english.php b/plugins/links/language/english.php index e99081ad6..9b0e2611f 100644 --- a/plugins/links/language/english.php +++ b/plugins/links/language/english.php @@ -311,5 +311,3 @@ 12 => array('No access' => 0, 'Read-Only' => 2, 'Read-Write' => 3), 13 => array('No access' => 0, 'Use' => 2) ); - -?> diff --git a/plugins/links/language/english_utf-8.php b/plugins/links/language/english_utf-8.php index 7bb71f75c..4a8bb6ec6 100644 --- a/plugins/links/language/english_utf-8.php +++ b/plugins/links/language/english_utf-8.php @@ -311,5 +311,3 @@ 12 => array('No access' => 0, 'Read-Only' => 2, 'Read-Write' => 3), 13 => array('No access' => 0, 'Use' => 2) ); - -?> diff --git a/plugins/links/sql/mysql_install.php b/plugins/links/sql/mysql_install.php index 0967b896f..a44cb9fbc 100644 --- a/plugins/links/sql/mysql_install.php +++ b/plugins/links/sql/mysql_install.php @@ -102,5 +102,3 @@ PRIMARY KEY (lid) ) ENGINE=MyISAM "; - -?> diff --git a/plugins/links/sql/mysql_updates.php b/plugins/links/sql/mysql_updates.php index 9d1c7ef0e..93682459f 100644 --- a/plugins/links/sql/mysql_updates.php +++ b/plugins/links/sql/mysql_updates.php @@ -139,5 +139,3 @@ function links_update_ConfigSecurity_2_1_0() } } - -?> diff --git a/plugins/links/sql/pgsql_install.php b/plugins/links/sql/pgsql_install.php index a44358737..da9023cbb 100644 --- a/plugins/links/sql/pgsql_install.php +++ b/plugins/links/sql/pgsql_install.php @@ -101,5 +101,3 @@ PRIMARY KEY (lid) ) "; - -?> diff --git a/plugins/links/sql/pgsql_updates.php b/plugins/links/sql/pgsql_updates.php index 4c04d5abf..162957a4a 100644 --- a/plugins/links/sql/pgsql_updates.php +++ b/plugins/links/sql/pgsql_updates.php @@ -78,5 +78,3 @@ function links_update_ConfigSecurity_2_1_0() } } - -?> diff --git a/plugins/polls/functions.inc b/plugins/polls/functions.inc index 753e8a9d4..6b647ded1 100644 --- a/plugins/polls/functions.inc +++ b/plugins/polls/functions.inc @@ -748,6 +748,7 @@ function POLLS_pollsave($pid, $aid) * @param int $scale Size in pixels to scale formatted results to * @param string $order 'ASC' or 'DESC' for Comment ordering (SQL statment ordering) * @param string $mode Comment Mode possible values 'nocomment', 'flat', 'nested', 'threaded' + * @param int $page * @param int $displaytype Possible values 0 = Normal, 1 = In Block, 2 = autotag * @see POLLS_pollVote * @see POLLS_showPoll @@ -1568,10 +1569,10 @@ function plugin_getcommenturlid_polls() * * @param string $op * @param string $content - * @param string $autotag - * @return mixed + * @param array $autotag + * @return array|string */ -function plugin_autotags_polls($op, $content = '', $autotag = '') +function plugin_autotags_polls($op, $content = '', $autotag = array()) { global $_CONF, $_PO_CONF, $_TABLES, $LANG_POLLS, $_GROUPS; diff --git a/plugins/polls/language/english.php b/plugins/polls/language/english.php index 7cd212592..3c02530b7 100644 --- a/plugins/polls/language/english.php +++ b/plugins/polls/language/english.php @@ -186,5 +186,3 @@ 14 => array('No access' => 0, 'Read-Only' => 2), 15 => array('All' => TOPIC_ALL_OPTION, 'Homepage Only' => TOPIC_HOMEONLY_OPTION, 'Select Topics' => TOPIC_SELECTED_OPTION) ); - -?> diff --git a/plugins/polls/templates/denim/functions.php b/plugins/polls/templates/denim/functions.php index aa9812c8e..586696899 100644 --- a/plugins/polls/templates/denim/functions.php +++ b/plugins/polls/templates/denim/functions.php @@ -48,5 +48,3 @@ function polls_js_files_denim() // No extra JS files needed by plugin. Assume theme loads all required. return array(); } - -?> diff --git a/plugins/recaptcha/functions.inc b/plugins/recaptcha/functions.inc index 467fbeab1..eead5885f 100644 --- a/plugins/recaptcha/functions.inc +++ b/plugins/recaptcha/functions.inc @@ -30,6 +30,11 @@ // | | // +---------------------------------------------------------------------------+ +use ReCaptcha\ReCaptcha; +use ReCaptcha\RequestMethod\CurlPost; +use ReCaptcha\RequestMethod\Post; +use ReCaptcha\RequestMethod\SocketPost; + if (stripos($_SERVER['PHP_SELF'], basename(__FILE__)) !== false) { die('This file cannot be used on its own.'); } @@ -207,6 +212,7 @@ function plugin_autouninstall_recaptcha() /** * Return the URL to a given document * + * @param string $file * @return string */ function plugin_getdocumentationurl_recaptcha($file) @@ -336,11 +342,11 @@ function plugin_itemPreSave_recaptcha($type, $content = '') } if (is_callable('curl_init')) { - $recaptcha = new \ReCaptcha\ReCaptcha($secretKey, new \ReCaptcha\RequestMethod\CurlPost()); + $recaptcha = new ReCaptcha($secretKey, new CurlPost()); } elseif (@ini_get('allow_url_fopen')) { - $recaptcha = new \ReCaptcha\ReCaptcha($secretKey, new \ReCaptcha\RequestMethod\Post()); + $recaptcha = new ReCaptcha($secretKey, new Post()); } else { - $recaptcha = new \ReCaptcha\ReCaptcha($secretKey, new \ReCaptcha\RequestMethod\SocketPost()); + $recaptcha = new ReCaptcha($secretKey, new SocketPost()); } $resp = $recaptcha->verify(@$_POST['g-recaptcha-response'], RECAPTCHA_getIP()); diff --git a/plugins/recaptcha/vendor/ReCaptcha/ReCaptcha.php b/plugins/recaptcha/vendor/ReCaptcha/ReCaptcha.php index c157dc9a3..94dc152d7 100644 --- a/plugins/recaptcha/vendor/ReCaptcha/ReCaptcha.php +++ b/plugins/recaptcha/vendor/ReCaptcha/ReCaptcha.php @@ -26,6 +26,8 @@ namespace ReCaptcha; +use RuntimeException; + /** * reCAPTCHA client. */ @@ -54,16 +56,16 @@ class ReCaptcha * * @param string $secret shared secret between site and reCAPTCHA server. * @param RequestMethod $requestMethod method used to send the request. Defaults to POST. - * @throws \RuntimeException if $secret is invalid + * @throws RuntimeException if $secret is invalid */ public function __construct($secret, RequestMethod $requestMethod = null) { if (empty($secret)) { - throw new \RuntimeException('No secret provided'); + throw new RuntimeException('No secret provided'); } if (!is_string($secret)) { - throw new \RuntimeException('The provided secret must be a string'); + throw new RuntimeException('The provided secret must be a string'); } $this->secret = $secret; diff --git a/plugins/recaptcha/vendor/ReCaptcha/RequestMethod/Socket.php b/plugins/recaptcha/vendor/ReCaptcha/RequestMethod/Socket.php index f51f1239a..773289c93 100644 --- a/plugins/recaptcha/vendor/ReCaptcha/RequestMethod/Socket.php +++ b/plugins/recaptcha/vendor/ReCaptcha/RequestMethod/Socket.php @@ -43,7 +43,7 @@ class Socket * @param int $errno * @param string $errstr * @param float $timeout - * @return resource + * @return resource|false */ public function fsockopen($hostname, $port = -1, &$errno = 0, &$errstr = '', $timeout = null) { diff --git a/plugins/recaptcha/vendor/ReCaptcha/RequestMethod/SocketPost.php b/plugins/recaptcha/vendor/ReCaptcha/RequestMethod/SocketPost.php index 47541215f..a353af10c 100644 --- a/plugins/recaptcha/vendor/ReCaptcha/RequestMethod/SocketPost.php +++ b/plugins/recaptcha/vendor/ReCaptcha/RequestMethod/SocketPost.php @@ -66,7 +66,7 @@ class SocketPost implements RequestMethod /** * Constructor * - * @param \ReCaptcha\RequestMethod\Socket $socket optional socket, injectable for testing + * @param Socket $socket optional socket, injectable for testing */ public function __construct(Socket $socket = null) { diff --git a/plugins/recaptcha/vendor/ReCaptcha/Response.php b/plugins/recaptcha/vendor/ReCaptcha/Response.php index 111df978a..d9e41fe8d 100644 --- a/plugins/recaptcha/vendor/ReCaptcha/Response.php +++ b/plugins/recaptcha/vendor/ReCaptcha/Response.php @@ -47,7 +47,7 @@ class Response * Build the response from the expected JSON returned by the service. * * @param string $json - * @return \ReCaptcha\Response + * @return Response */ public static function fromJson($json) { diff --git a/plugins/spamx/BaseAdmin.class.php b/plugins/spamx/BaseAdmin.class.php index 44aca725f..061dbbfa6 100644 --- a/plugins/spamx/BaseAdmin.class.php +++ b/plugins/spamx/BaseAdmin.class.php @@ -70,7 +70,8 @@ protected function getEntry() /** * Removes an entry from database * - * @return boolean true = success, false = otherwise + * @param string $entry + * @return bool true = success, false = otherwise */ protected function deleteEntry($entry) { @@ -89,7 +90,8 @@ protected function deleteEntry($entry) /** * Removes all entries the user selected from database * - * @return boolean true = success, false = otherwise + * @param array $entries + * @return bool true = success, false = otherwise */ protected function deleteSelectedEntries(array $entries) { diff --git a/plugins/spamx/functions.inc b/plugins/spamx/functions.inc index 527dd70e8..32576e255 100644 --- a/plugins/spamx/functions.inc +++ b/plugins/spamx/functions.inc @@ -454,7 +454,7 @@ function plugin_migrate_spamx($old_conf) * @return int either PLG_SPAM_NOT_FOUND, PLG_SPAM_FOUND or PLG_SPAM_UNSURE * @note As for valid value for $commentType, see system/classes/Akismet.php */ -function plugin_checkforSpam_spamx($comment, $action = -1, $permanentLink, +function plugin_checkforSpam_spamx($comment, $action, $permanentLink, $commentType = Geeklog\Akismet::COMMENT_TYPE_COMMENT, $commentAuthor = null, $commentAuthorEmail = null, $commentAuthorURL = null) { diff --git a/plugins/staticpages/functions.inc b/plugins/staticpages/functions.inc index fd3a54046..c1b4b14ba 100755 --- a/plugins/staticpages/functions.inc +++ b/plugins/staticpages/functions.inc @@ -271,7 +271,8 @@ function plugin_deletecomment_staticpages($cid, $id) /** * Did user create any pages * - * @return string number of pages user contributed. If nothing leave blank + * @param int $uid + * @return string number of pages user contributed. If nothing leave blank */ function plugin_usercontributed_staticpages($uid) { @@ -714,6 +715,7 @@ function SP_printPage($page, $A) * @param string $mode type of display to return ('', 'print', 'autotag' * @param string $comment_order sorting of comments * @param string $comment_mode comment mode (nested, flat, etc.) + * @param int $comment_page * @param int $msg optional message number * @param string $query optional search query string to highlight * @return string HTML for the static page @@ -730,7 +732,7 @@ function SP_returnStaticpage($page = '', $mode = '', $comment_order = 'ASC', $co ); $svc_msg = array(); - if (PLG_invokeService('staticpages', 'get', $args, $retval, $svc_msg) == PLG_RET_OK) { + if (PLG_invokeService('staticpages', 'get', $args, $output, $svc_msg) == PLG_RET_OK) { // Grab page id from database since some comparisons are case sensitive // and staticpage ids are not. $result = DB_query( @@ -745,11 +747,11 @@ function SP_returnStaticpage($page = '', $mode = '', $comment_order = 'ASC', $co } if ($mode === 'print') { - $retval = SP_printPage($page, $retval); + $retval = SP_printPage($page, $output); } elseif ($mode === 'autotag') { - $retval = $retval['sp_content']; + $retval = $output['sp_content']; } else { - $retval = SP_displayPage($page, $retval, $comment_order, $comment_mode, $comment_page, $msg, $query); + $retval = SP_displayPage($page, $output, $comment_order, $comment_mode, $comment_page, $msg, $query); } // Increment hit counter for page, but don't count views for the author @@ -876,13 +878,14 @@ function plugin_searchtypes_staticpages() * @param string $keyType search key type: 'all', 'phrase', 'any' * @param int $page page number of current search (deprecated) * @param int $perpage number of results per page (deprecated) + * @return array */ function plugin_dopluginsearch_staticpages($query, $datestart, $dateend, $topic, $type, $author, $keyType, $page, $perpage) { global $_TABLES, $_DB_dbms, $LANG_STATIC, $LANG09, $_SP_CONF; if ($_SP_CONF['includesearch'] != 1) { - return; + return array(); } // Make sure the query is SQL safe @@ -1036,7 +1039,7 @@ function plugin_getadminoption_staticpages() * @param int $u_id User ID if blank current user * @return string Where clause of sql statement */ -function SP_getPerms($table = '', $access = '2', $u_id = '') +function SP_getPerms($table = '', $access = 2, $u_id = 0) { global $_USER, $_GROUPS; @@ -1044,7 +1047,7 @@ function SP_getPerms($table = '', $access = '2', $u_id = '') $table .= '.'; } - if ($u_id == '') { + if (empty($u_id)) { if (isset ($_USER['uid'])) { $uid = $_USER['uid']; } else { @@ -1220,7 +1223,7 @@ function plugin_centerblock_staticpages($where = 1, $page = 1, $topic = '') $spage->set_var('hits', $hits); } - $SP_retval = ''; + $SP_retval = array(); $mode = ''; $args = array( 'sp_id' => $S['sp_id'], @@ -1330,10 +1333,10 @@ function plugin_chkVersion_staticpages() * * @param string $op * @param string $content - * @param string - * @return string + * @param array $autotag + * @return string|array */ -function plugin_autotags_staticpages($op, $content = '', $autotag = '') +function plugin_autotags_staticpages($op, $content = '', $autotag = array()) { global $_CONF, $_TABLES, $_SP_CONF, $LANG_STATIC, $_GROUPS; @@ -1890,17 +1893,9 @@ function plugin_getListField_staticpages($fieldname, $fieldvalue, $A, $icon_arr) /** * Render the actual content of a static page (without any surrounding blocks) * - * @param string $sp_id the id - * @param string $sp_id the title of the page. Used to set {sp_title} template variable - * @param string $sp_content the content (HTML or PHP source) - * @param int $sp_php flag: 1 = content is PHP source, 0 = is HTML - * @param int $cache_time the max cache time of this page - * @param string $template_id Template used for content - * @param string $created Created date of page - * @param string $modified Last modified date of page + * @param array $A * @return string rendered content (HTML) */ -//function SP_render_content($sp_id, $sp_title, $sp_content, $sp_php, $cache_time = 0, $template_id = '', $created = '', $modified = '') function SP_render_content($A) { global $_CONF, $_SP_CONF, $LANG_STATIC, $_STRUCT_DATA; @@ -1977,7 +1972,7 @@ function SP_render_content($A) ); $svc_msg = array(); - if (PLG_invokeService('staticpages', 'get', $args, $retval, $svc_msg) == PLG_RET_OK) { + if (PLG_invokeService('staticpages', 'get', $args, $output, $svc_msg) == PLG_RET_OK) { // Need to do below twice for backwards compatibility with pre Staticpage plugin v1.6.8 way of handling templates // Reason is in case [staticpage_content: autotag is in staticpage template page variable which is used to load staticpage within staticpage template. @@ -1986,7 +1981,7 @@ function SP_render_content($A) // Treat as normal staticpage template but really just want to use a view and load no files $sp_template = COM_newTemplate(CTL_plugin_templatePath('staticpages')); $sp_template->set_view(array( - 'page_view' => $retval['sp_content'], + 'page_view' => $output['sp_content'], )); // Staticpage specific template variables @@ -2001,7 +1996,7 @@ function SP_render_content($A) $sp_template->set_var($key, $value); } - $retval['sp_content'] = $sp_template->finish($sp_template->parse('output', 'page_view')); + $output['sp_content'] = $sp_template->finish($sp_template->parse('output', 'page_view')); } /* Old way of applying variables left for bug checking (Staticpage plugin v1.6.8, Geeklog v2.1.2) @@ -2010,7 +2005,7 @@ function SP_render_content($A) // If template variable format is different then any unused ones will display $retval['sp_content'] = preg_replace('/{[^ \t\r\n}]+}/', '', $retval['sp_content']); */ - $sp_content = $retval['sp_content']; + $sp_content = $output['sp_content']; } } @@ -2386,8 +2381,8 @@ function plugin_getiteminfo_staticpages($sp_id, $what, $uid = 0, $options = arra ); $svc_msg = array(); - if (PLG_invokeService('staticpages', 'get', $args, $retval, $svc_msg) == PLG_RET_OK) { - $props[$p] = $retval['sp_content']; + if (PLG_invokeService('staticpages', 'get', $args, $output, $svc_msg) == PLG_RET_OK) { + $props[$p] = $output['sp_content']; } break; diff --git a/plugins/staticpages/services.inc.php b/plugins/staticpages/services.inc.php index 29735bf2d..503bd34ae 100644 --- a/plugins/staticpages/services.inc.php +++ b/plugins/staticpages/services.inc.php @@ -54,8 +54,8 @@ * * @param array $args Contains all the data provided by the client * @param string $output OUTPUT parameter containing the returned text - * @param string $svc_msg OUTPUT parameter containing any service messages - * @return int Response code as defined in lib-plugins.php + * @param array $svc_msg OUTPUT parameter containing any service messages + * @return int Response code as defined in lib-plugins.php */ function service_submit_staticpages($args, &$output, &$svc_msg) { @@ -995,9 +995,10 @@ function service_get_staticpages($args, &$output, &$svc_msg) /** * Get all the topics available * - * @param array $args Contains all the data provided by the client - * @param string &$output OUTPUT parameter containing the returned text - * @return int Response code as defined in lib-plugins.php + * @param array $args Contains all the data provided by the client + * @param string &$output OUTPUT parameter containing the returned text + * @param string &$svc_msg + * @return int Response code as defined in lib-plugins.php */ function service_getTopicList_staticpages($args, &$output, &$svc_msg) { diff --git a/plugins/xmlsitemap/sql/mysql_install.php b/plugins/xmlsitemap/sql/mysql_install.php index 53c1ea693..8ac497eb3 100644 --- a/plugins/xmlsitemap/sql/mysql_install.php +++ b/plugins/xmlsitemap/sql/mysql_install.php @@ -49,5 +49,3 @@ $DEFVALUES[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('xmlsitemap_filename', '" . DB_escapeString($_XMLSMAP_DEFAULT['sitemap_file']) . "')"; $DEFVALUES[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('xmlsitemap_mobile', '" . DB_escapeString($_XMLSMAP_DEFAULT['mobile_sitemap_file']) . "')"; $DEFVALUES[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('xmlsitemap_news', '" . DB_escapeString($_XMLSMAP_DEFAULT['news_sitemap_file']) . "')"; - -?> diff --git a/plugins/xmlsitemap/sql/mysql_updates.php b/plugins/xmlsitemap/sql/mysql_updates.php index 9dfd53e92..d602c1186 100644 --- a/plugins/xmlsitemap/sql/mysql_updates.php +++ b/plugins/xmlsitemap/sql/mysql_updates.php @@ -128,5 +128,3 @@ function xmlsitemap_update_ConfigSecurity_1_0_1() } } - -?> diff --git a/plugins/xmlsitemap/sql/pgsql_install.php b/plugins/xmlsitemap/sql/pgsql_install.php index 534977dd0..9daeac236 100644 --- a/plugins/xmlsitemap/sql/pgsql_install.php +++ b/plugins/xmlsitemap/sql/pgsql_install.php @@ -46,5 +46,3 @@ $DEFVALUES[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('xmlsitemap_filename', '" . DB_escapeString($_XMLSMAP_DEFAULT['sitemap_file']) . "')"; $DEFVALUES[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('xmlsitemap_mobile', '" . DB_escapeString($_XMLSMAP_DEFAULT['mobile_sitemap_file']) . "')"; $DEFVALUES[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('xmlsitemap_news', '" . DB_escapeString($_XMLSMAP_DEFAULT['news_sitemap_file']) . "')"; - -?> diff --git a/plugins/xmlsitemap/sql/pgsql_updates.php b/plugins/xmlsitemap/sql/pgsql_updates.php index b3a856f61..0b3163563 100644 --- a/plugins/xmlsitemap/sql/pgsql_updates.php +++ b/plugins/xmlsitemap/sql/pgsql_updates.php @@ -128,5 +128,3 @@ function xmlsitemap_update_ConfigSecurity_1_0_1() } } - -?> diff --git a/system/lib-plugins.php b/system/lib-plugins.php index c64861029..17029112b 100644 --- a/system/lib-plugins.php +++ b/system/lib-plugins.php @@ -608,9 +608,9 @@ function PLG_commentPreSave($uid, &$title, &$comment, $sid, $pid, $type, &$postM * * @author Mark Evans, mevans AT ecsnet DOT com * @access public - * @param string $type Type of item, i.e.; registration, contact ... - * @param string $content item specific content - * @return string empty is no error, error message if error was encountered + * @param string $type Type of item, i.e.; registration, contact ... + * @param string|array $content item specific content + * @return string empty is no error, error message if error was encountered * @see PLG_commentPreSave */ function PLG_itemPreSave($type, $content)