Skip to content

Commit

Permalink
Removed deprecated HTML tags and fixed PHPDoc descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Aug 17, 2019
1 parent 27ebf15 commit d8615ad
Show file tree
Hide file tree
Showing 38 changed files with 100 additions and 135 deletions.
12 changes: 6 additions & 6 deletions plugins/calendar/autoinstall.php
Expand Up @@ -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)
{
Expand Down Expand Up @@ -151,5 +153,3 @@ function plugin_compatible_with_this_version_calendar($pi_name)

return true;
}

?>
16 changes: 12 additions & 4 deletions plugins/calendar/functions.inc
Expand Up @@ -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';
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 0 additions & 2 deletions plugins/calendar/install_defaults.php
Expand Up @@ -223,5 +223,3 @@ function plugin_initconfig_calendar()

return true;
}

?>
2 changes: 0 additions & 2 deletions plugins/calendar/install_updates.php
Expand Up @@ -68,5 +68,3 @@ function calendar_update_ConfValues_1_1_2()

return true;
}

?>
2 changes: 0 additions & 2 deletions plugins/calendar/language/english.php
Expand Up @@ -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)
);

?>
2 changes: 0 additions & 2 deletions plugins/calendar/language/english_utf-8.php
Expand Up @@ -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)
);

?>
2 changes: 0 additions & 2 deletions plugins/calendar/sql/mysql_install.php
Expand Up @@ -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)";

?>
2 changes: 0 additions & 2 deletions plugins/calendar/sql/mysql_updates.php
Expand Up @@ -140,5 +140,3 @@ function calendar_update_Zipcode_1_1_2()
{
// Nothing to do
}

?>
2 changes: 0 additions & 2 deletions plugins/calendar/sql/pgsql_install.php
Expand Up @@ -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)";

?>
2 changes: 0 additions & 2 deletions plugins/calendar/sql/pgsql_updates.php
Expand Up @@ -126,5 +126,3 @@ function calendar_update_Zipcode_1_1_2()
DB_query($sql);
}
}

?>
18 changes: 8 additions & 10 deletions plugins/links/autoinstall.php
Expand Up @@ -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;
Expand Down Expand Up @@ -204,5 +204,3 @@ function plugin_compatible_with_this_version_links($pi_name)

return true;
}

?>
2 changes: 0 additions & 2 deletions plugins/links/configuration_validation.php
Expand Up @@ -95,5 +95,3 @@
$_CONF_VALIDATE['links']['autotag_permissions_link[3]'] = array(
'rule' => array('inList', array(0, 2), true)
);

?>
36 changes: 17 additions & 19 deletions plugins/links/functions.inc
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand All @@ -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');

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 0 additions & 2 deletions plugins/links/install_defaults.php
Expand Up @@ -254,5 +254,3 @@ function plugin_initconfig_links()

return true;
}

?>
2 changes: 0 additions & 2 deletions plugins/links/install_updates.php
Expand Up @@ -25,5 +25,3 @@ function links_update_ConfValues_2_1_0()

return true;
}

?>
2 changes: 0 additions & 2 deletions plugins/links/language/english.php
Expand Up @@ -311,5 +311,3 @@
12 => array('No access' => 0, 'Read-Only' => 2, 'Read-Write' => 3),
13 => array('No access' => 0, 'Use' => 2)
);

?>
2 changes: 0 additions & 2 deletions plugins/links/language/english_utf-8.php
Expand Up @@ -311,5 +311,3 @@
12 => array('No access' => 0, 'Read-Only' => 2, 'Read-Write' => 3),
13 => array('No access' => 0, 'Use' => 2)
);

?>
2 changes: 0 additions & 2 deletions plugins/links/sql/mysql_install.php
Expand Up @@ -102,5 +102,3 @@
PRIMARY KEY (lid)
) ENGINE=MyISAM
";

?>
2 changes: 0 additions & 2 deletions plugins/links/sql/mysql_updates.php
Expand Up @@ -139,5 +139,3 @@ function links_update_ConfigSecurity_2_1_0()
}

}

?>
2 changes: 0 additions & 2 deletions plugins/links/sql/pgsql_install.php
Expand Up @@ -101,5 +101,3 @@
PRIMARY KEY (lid)
)
";

?>
2 changes: 0 additions & 2 deletions plugins/links/sql/pgsql_updates.php
Expand Up @@ -78,5 +78,3 @@ function links_update_ConfigSecurity_2_1_0()
}

}

?>
7 changes: 4 additions & 3 deletions plugins/polls/functions.inc
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions plugins/polls/language/english.php
Expand Up @@ -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)
);

?>
2 changes: 0 additions & 2 deletions plugins/polls/templates/denim/functions.php
Expand Up @@ -48,5 +48,3 @@ function polls_js_files_denim()
// No extra JS files needed by plugin. Assume theme loads all required.
return array();
}

?>
12 changes: 9 additions & 3 deletions plugins/recaptcha/functions.inc
Expand Up @@ -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.');
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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());
Expand Down
8 changes: 5 additions & 3 deletions plugins/recaptcha/vendor/ReCaptcha/ReCaptcha.php
Expand Up @@ -26,6 +26,8 @@

namespace ReCaptcha;

use RuntimeException;

/**
* reCAPTCHA client.
*/
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d8615ad

Please sign in to comment.