diff --git a/core/Models/ConfigItem.php b/core/Models/ConfigItem.php index f8951792883e..bec06cd669e8 100644 --- a/core/Models/ConfigItem.php +++ b/core/Models/ConfigItem.php @@ -158,9 +158,9 @@ public function getConfValueForOutput() { */ public function setConfValueForInput($value, $force_slash = false) { if ($this->conf_formtype == 'textarea' && $this->conf_valuetype !== 'array') { - $value = icms_core_DataFilter::checkVar($value, 'html', 'input'); + $value = DataFilter::checkVar($value, 'html', 'input'); } elseif ($this->conf_formtype == 'textsarea' && $this->conf_valuetype !== 'array') { - $value = icms_core_DataFilter::checkVar($value, 'text', 'input'); + $value = DataFilter::checkVar($value, 'text', 'input'); } elseif ($this->conf_formtype == 'password') { $value = filter_var($value, FILTER_SANITIZE_URL); } else { diff --git a/edituser.php b/edituser.php index 1c0dcacaf3b4..af5887a69621 100644 --- a/edituser.php +++ b/edituser.php @@ -27,15 +27,17 @@ /** * Generates form and validation for editing users * - * @copyright http://www.xoops.org/ The Xoops Project - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL) - * @package Member - * @subpackage Users - * @since Xoops - * @author skalpa + * @copyright http://www.xoops.org/ The Xoops Project + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL) + * @package Member + * @subpackage Users + * @since Xoops + * @author skalpa */ +use ImpressCMS\Core\DataFilter; + $xoopsOption['pagetype'] = 'user'; if (icms_get_module_status('profile') && file_exists(ICMS_MODULES_PATH . '/profile/edituser.php')) { header('Location: ' . ICMS_MODULES_URL . '/profile/edituser.php'); @@ -94,11 +96,11 @@ ); if (!empty($_GET)) { - $clean_GET = icms_core_DataFilter::checkVarArray($_GET, $filter_get, false); + $clean_GET = DataFilter::checkVarArray($_GET, $filter_get, false); extract($clean_GET); } if (!empty($_POST)) { - $clean_POST = icms_core_DataFilter::checkVarArray($_POST, $filter_post, false); + $clean_POST = DataFilter::checkVarArray($_POST, $filter_post, false); extract($clean_POST); } @@ -116,17 +118,17 @@ if ($icmsConfigUser['allow_chgmail'] == 1) { if (!empty($email)) { - $email = icms_core_DataFilter::stripSlashesGPC(trim($email)); + $email = DataFilter::stripSlashesGPC(trim($email)); } - if ($email == '' || !icms_core_DataFilter::checkVar($email, 'email', 0, 1)) { + if ($email == '' || !DataFilter::checkVar($email, 'email', 0, 1)) { $errors[] = _US_INVALIDMAIL; } $count = 0; if ($email) { $sql = sprintf('SELECT COUNT(*) FROM %s WHERE email = %s', - icms::$xoopsDB->prefix('users'), icms::$xoopsDB->quoteString(addslashes($email))); + icms::$xoopsDB->prefix('users'), icms::$xoopsDB->quoteString(addslashes($email))); $result = icms::$xoopsDB->query($sql); list($count) = icms::$xoopsDB->fetchRow($result); if ($count > 1) { @@ -137,7 +139,7 @@ if ($icmsConfigUser['allow_chguname'] == 1) { if (!empty($uname)) { - $uname = icms_core_DataFilter::stripSlashesGPC(trim($uname)); + $uname = DataFilter::stripSlashesGPC(trim($uname)); } if ($uname == '') { @@ -171,9 +173,9 @@ } if (!empty($password)) { - $password = icms_core_DataFilter::stripSlashesGPC(trim($password)); + $password = DataFilter::stripSlashesGPC(trim($password)); $oldpass = !empty($old_password) - ? icms_core_DataFilter::stripSlashesGPC(trim($old_password)) + ? DataFilter::stripSlashesGPC(trim($old_password)) : ''; $member_handler = icms::handler('icms_member'); @@ -187,7 +189,7 @@ } if (!empty($vpass)) { - $vpass = icms_core_DataFilter::stripSlashesGPC(trim($vpass)); + $vpass = DataFilter::stripSlashesGPC(trim($vpass)); } if ($password != $vpass) { @@ -195,7 +197,7 @@ } if ($password == $username - || $password == icms_core_DataFilter::utf8_strrev($username, true) + || $password == DataFilter::utf8_strrev($username, true) || strripos($password, $username) === true ) { $errors[] = _US_BADPWD; @@ -224,10 +226,10 @@ $edituser->user_from = $user_from; if ($icmsConfigUser['allwshow_sig'] == 1) { if ($icmsConfigUser['allow_htsig'] == 0) { - $signature = strip_tags(icms_core_DataFilter::checkVar($user_sig, 'text', 'input')); - $edituser->user_sig = icms_core_DataFilter::icms_substr($signature, 0, (int) $icmsConfigUser['sig_max_length']); + $signature = strip_tags(DataFilter::checkVar($user_sig, 'text', 'input')); + $edituser->user_sig = DataFilter::icms_substr($signature, 0, (int)$icmsConfigUser['sig_max_length']); } else { - $signature = icms_core_DataFilter::checkVar($user_sig, 'html', 'input'); + $signature = DataFilter::checkVar($user_sig, 'html', 'input'); $edituser->user_sig = $signature; } } @@ -240,14 +242,14 @@ $edituser->setVar('pass', $pass, true); } - $attachsig = !empty($attachsig)?1:0; + $attachsig = !empty($attachsig) ? 1 : 0; $edituser->attachsig = $attachsig; $edituser->timezone_offset = $timezone_offset; $edituser->uorder = $uorder; $edituser->umode = $umode; $edituser->notify_method = $notify_method; $edituser->notify_mode = $notify_mode; - $edituser->bio = icms_core_DataFilter::icms_substr($bio, 0, 255); + $edituser->bio = DataFilter::icms_substr($bio, 0, 255); $edituser->user_occ = $user_occ; $edituser->user_intrest = $user_intrest; $edituser->user_mailok = $user_mailok; @@ -539,10 +541,10 @@ $avt_handler = icms::handler('icms_data_avatar'); if (!empty($user_avatar)) { - $user_avatar = icms_core_DataFilter::addSlashes(trim($user_avatar)); + $user_avatar = DataFilter::addSlashes(trim($user_avatar)); $criteria_avatar = new icms_db_criteria_Compo(new icms_db_criteria_Item('avatar_file', $user_avatar)); $criteria_avatar->add(new icms_db_criteria_Item('avatar_type', "S")); - $avatars = & $avt_handler->getObjects($criteria_avatar); + $avatars = &$avt_handler->getObjects($criteria_avatar); if (!is_array($avatars) || !count($avatars)) { $user_avatar = 'blank.gif'; } diff --git a/include/checklogin.php b/include/checklogin.php index ba4dd1d2c21c..490dad1924b2 100644 --- a/include/checklogin.php +++ b/include/checklogin.php @@ -42,6 +42,7 @@ * @since XOOPS */ +use ImpressCMS\Core\DataFilter; use ImpressCMS\Core\Facades\Member; icms_loadLanguageFile('core', 'user'); @@ -81,15 +82,15 @@ $member_handler = icms::handler('icms_member'); icms_loadLanguageFile('core', 'auth'); -$icmsAuth = & icms_auth_Factory::getAuthConnection(icms_core_DataFilter::addSlashes($uname)); +$icmsAuth = &icms_auth_Factory::getAuthConnection(DataFilter::addSlashes($uname)); -$uname4sql = addslashes(icms_core_DataFilter::stripSlashesGPC($uname)); -$pass4sql = icms_core_DataFilter::stripSlashesGPC($pass); +$uname4sql = addslashes(DataFilter::stripSlashesGPC($uname)); +$pass4sql = DataFilter::stripSlashesGPC($pass); /* Check to see if being access by a user - if not, attempt to authenticate */ if (empty($user) || !is_object($user)) { - $user = & $icmsAuth->authenticate($uname4sql, $pass4sql); + $user = &$icmsAuth->authenticate($uname4sql, $pass4sql); } /* User exists: check to see if the user has been activated. diff --git a/include/comment_form.php b/include/comment_form.php index 559ae3f06521..d5df1463f64c 100644 --- a/include/comment_form.php +++ b/include/comment_form.php @@ -27,15 +27,17 @@ /** * The comment form extra include file * - * @copyright http://www.xoops.org/ The XOOPS Project - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license LICENSE.txt - * @package core - * @since XOOPS - * @author http://www.xoops.org The XOOPS Project - * @author modified by UnderDog + * @copyright http://www.xoops.org/ The XOOPS Project + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license LICENSE.txt + * @package core + * @since XOOPS + * @author http://www.xoops.org The XOOPS Project + * @author modified by UnderDog */ +use ImpressCMS\Core\DataFilter; + if (!is_object($icmsModule)) { exit(); } @@ -127,9 +129,9 @@ foreach ($comment_config['extraParams'] as $extra_param) { // This routine is included from forms accessed via both GET and POST if (isset($_POST[$extra_param])) { - $hidden_value = icms_core_DataFilter::stripSlashesGPC($_POST[$extra_param]); + $hidden_value = DataFilter::stripSlashesGPC($_POST[$extra_param]); } elseif (isset($_GET[$extra_param])) { - $hidden_value = icms_core_DataFilter::stripSlashesGPC($_GET[$extra_param]); + $hidden_value = DataFilter::stripSlashesGPC($_GET[$extra_param]); } else { $hidden_value = ''; } diff --git a/include/comment_new.php b/include/comment_new.php index 411e920761d7..e7128504d7d1 100644 --- a/include/comment_new.php +++ b/include/comment_new.php @@ -31,15 +31,18 @@ /** * The new comment include file * - * @copyright http://www.xoops.org/ The XOOPS Project - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license LICENSE.txt - * @package Administration - * @subpackage Comments - * @since XOOPS - * @author http://www.xoops.org The XOOPS Project - * @author modified by UnderDog + * @copyright http://www.xoops.org/ The XOOPS Project + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license LICENSE.txt + * @package Administration + * @subpackage Comments + * @since XOOPS + * @author http://www.xoops.org The XOOPS Project + * @author modified by UnderDog */ + +use ImpressCMS\Core\DataFilter; + include_once ICMS_INCLUDE_PATH . '/comment_constants.php'; if (('system' != $icmsModule->dirname && XOOPS_COMMENT_APPROVENONE == $icmsModuleConfig['com_rule']) || (!is_object(icms::$user) && !$icmsModuleConfig['com_anonpost']) @@ -58,9 +61,9 @@ //themecenterposts($com_replytitle, $com_replytext); echo '
' . $com_replytitle . '

' . $com_replytext . '
'; } - $com_title = icms_core_DataFilter::htmlSpecialChars($com_replytitle); + $com_title = DataFilter::htmlSpecialChars($com_replytitle); if (!preg_match("/^(Re|" . _CM_RE . "):/i", $com_title)) { - $com_title = _CM_RE . ": " . icms_core_DataFilter::icms_substr($com_title, 0, 56); + $com_title = _CM_RE . ": " . DataFilter::icms_substr($com_title, 0, 56); } } else { $com_title = ''; diff --git a/include/comment_post.php b/include/comment_post.php index 9a5d401f0775..3410f7f111bd 100644 --- a/include/comment_post.php +++ b/include/comment_post.php @@ -31,22 +31,24 @@ /** * The post a comment include file * - * @copyright http://www.xoops.org/ The XOOPS Project - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license LICENSE.txt - * @package core - * @since XOOPS - * @author http://www.xoops.org The XOOPS Project - * @author modified by UnderDog + * @copyright http://www.xoops.org/ The XOOPS Project + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license LICENSE.txt + * @package core + * @since XOOPS + * @author http://www.xoops.org The XOOPS Project + * @author modified by UnderDog */ +use ImpressCMS\Core\DataFilter; + if (!is_object($icmsModule)) { exit(); } icms_loadLanguageFile('core', 'comment'); include_once ICMS_INCLUDE_PATH . '/comment_constants.php'; if ('system' == $icmsModule->dirname) { - $com_id = isset($_POST['com_id'])?(int) $_POST['com_id']:0; + $com_id = isset($_POST['com_id']) ? (int)$_POST['com_id'] : 0; if (empty($com_id)) { exit(); } @@ -121,7 +123,7 @@ break; case "preview": $doimage = 1; - $com_title = icms_core_DataFilter::htmlSpecialChars(icms_core_DataFilter::stripSlashesGPC($_POST['com_title'])); + $com_title = DataFilter::htmlSpecialChars(DataFilter::stripSlashesGPC($_POST['com_title'])); if ($dohtml != 0) { if (is_object(icms::$user)) { if (!icms::$user->isAdmin($com_modid)) { @@ -134,9 +136,9 @@ $dohtml = 0; } } - $p_comment = icms_core_DataFilter::checkVar($_POST['com_text'], 'html', 'input'); - $noname = isset($noname)?(int) $noname:0; - $com_text = icms_core_DataFilter::htmlSpecialChars(icms_core_DataFilter::stripSlashesGPC($_POST['com_text'])); + $p_comment = DataFilter::checkVar($_POST['com_text'], 'html', 'input'); + $noname = isset($noname) ? (int)$noname : 0; + $com_text = DataFilter::htmlSpecialChars(DataFilter::stripSlashesGPC($_POST['com_text'])); if ($icmsModule->dirname != 'system') { include ICMS_ROOT_PATH . '/header.php'; //themecenterposts($com_title, $p_comment); @@ -278,23 +280,23 @@ $comment->com_status = XOOPS_COMMENT_PENDING; // RMV-NOTIFY $notify_event = 'comment_submit'; - break; + break; } } - $comment->com_uid = $uid; - } + $comment->com_uid = $uid; + } - $com_title = icms_core_DataFilter::icms_trim($_POST['com_title']); - $com_title = ($com_title == '')? _NOTITLE : $com_title; - $comment->com_title = $com_title; - $comment->com_text = $_POST['com_text']; - $comment->dohtml = $dohtml; - $comment->dosmiley = $dosmiley; - $comment->doxcode = $doxcode; - $comment->doimage = $doimage; - $comment->dobr = $dobr; - $comment->com_icon = $com_icon; - $comment->com_modified = time(); + $com_title = DataFilter::icms_trim($_POST['com_title']); + $com_title = ($com_title == '') ? _NOTITLE : $com_title; + $comment->com_title = $com_title; + $comment->com_text = $_POST['com_text']; + $comment->dohtml = $dohtml; + $comment->dosmiley = $dosmiley; + $comment->doxcode = $doxcode; + $comment->doimage = $doimage; + $comment->dobr = $dobr; + $comment->com_icon = $com_icon; + $comment->com_modified = time(); $comment->com_modid = $com_modid; if (isset($extra_params)) { $comment->com_exparams = $extra_params; diff --git a/include/comment_reply.php b/include/comment_reply.php index c8b3fe1cd279..c12f7335f1c7 100644 --- a/include/comment_reply.php +++ b/include/comment_reply.php @@ -31,22 +31,24 @@ /** * The commentreply include file * - * @copyright http://www.xoops.org/ The XOOPS Project - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license LICENSE.txt - * @package core - * @since XOOPS - * @author http://www.xoops.org The XOOPS Project - * @author modified by UnderDog + * @copyright http://www.xoops.org/ The XOOPS Project + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license LICENSE.txt + * @package core + * @since XOOPS + * @author http://www.xoops.org The XOOPS Project + * @author modified by UnderDog */ +use ImpressCMS\Core\DataFilter; + if (!is_object($icmsModule)) { exit(); } include_once ICMS_INCLUDE_PATH . '/comment_constants.php'; if (('system' != $icmsModule->dirname - && XOOPS_COMMENT_APPROVENONE == $icmsModuleConfig['com_rule']) + && XOOPS_COMMENT_APPROVENONE == $icmsModuleConfig['com_rule']) || (!is_object(icms::$user) && !$icmsModuleConfig['com_anonpost']) || !is_object($icmsModule)) { redirect_header(ICMS_URL . '/user.php', 1, _NOPERM); @@ -77,7 +79,7 @@ $r_text = _CM_POSTER . ': ' . $r_name . '  ' . _CM_POSTED . ': ' . formatTimestamp($comment->com_created) . '

' . $comment->com_text; $com_title = $comment->getVar('com_title', 'E'); if (!preg_match("/^(Re|" . _CM_RE . "):/i", $com_title)) { - $com_title = _CM_RE . ": " . icms_core_DataFilter::icms_substr($com_title, 0, 56); + $com_title = _CM_RE . ": " . DataFilter::icms_substr($com_title, 0, 56); } $com_pid = $com_id; $com_text = ''; diff --git a/include/comment_view.php b/include/comment_view.php index ad66420aa436..076726faa4f7 100644 --- a/include/comment_view.php +++ b/include/comment_view.php @@ -31,15 +31,17 @@ /** * The commentview include file * - * @copyright http://www.xoops.org/ The XOOPS Project - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license LICENSE.txt - * @package core - * @since XOOPS - * @author http://www.xoops.org The XOOPS Project - * @author modified by UnderDog + * @copyright http://www.xoops.org/ The XOOPS Project + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license LICENSE.txt + * @package core + * @since XOOPS + * @author http://www.xoops.org The XOOPS Project + * @author modified by UnderDog */ +use ImpressCMS\Core\DataFilter; + if (!is_object($icmsModule)) { exit(); } @@ -73,11 +75,11 @@ /* filter the user input */ if (!empty($_GET)) { - $clean_GET = icms_core_DataFilter::checkVarArray($_GET, $filter_get, false); + $clean_GET = DataFilter::checkVarArray($_GET, $filter_get, false); extract($clean_GET); } if (!empty($_POST)) { - $clean_POST = icms_core_DataFilter::checkVarArray($_POST, $filter_post, false); + $clean_POST = DataFilter::checkVarArray($_POST, $filter_post, false); extract($clean_POST); } diff --git a/include/commentform.inc.php b/include/commentform.inc.php index b0000a79c219..80ae30b5e92d 100644 --- a/include/commentform.inc.php +++ b/include/commentform.inc.php @@ -27,19 +27,21 @@ /** * The commentform include file * - * @copyright http://www.xoops.org/ The XOOPS Project - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license LICENSE.txt - * @package Administration - * @subpackage Comments - * @since XOOPS - * @author http://www.xoops.org The XOOPS Project - * @author modified by UnderDog + * @copyright http://www.xoops.org/ The XOOPS Project + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license LICENSE.txt + * @package Administration + * @subpackage Comments + * @since XOOPS + * @author http://www.xoops.org The XOOPS Project + * @author modified by UnderDog */ +use ImpressCMS\Core\DataFilter; + $cform = new icms_form_Theme(_CM_POSTCOMMENT, "commentform", "postcomment.php", "post", true); if (!preg_match("/^re:/i", $subject)) { - $subject = "Re: " . icms_core_DataFilter::icms_substr($subject, 0, 56); + $subject = "Re: " . DataFilter::icms_substr($subject, 0, 56); } $cform->addElement(new icms_form_elements_Text(_CM_TITLE, 'subject', 50, 255, $subject), true); $icons_radio = new icms_form_elements_Radio(_MESSAGEICON, 'icon', $icon); diff --git a/include/findusers.php b/include/findusers.php index 90c7da409ebf..4c22d8a66029 100644 --- a/include/findusers.php +++ b/include/findusers.php @@ -5,13 +5,15 @@ * limit: Only work with javascript enabled * @todo: plugins for external applications, including but not limited: sending massive emails/PMs, membership edit * - * @copyright The XOOPS project http://www.xoops.org/ - * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPLv2 or later license - * @author Taiwen Jiang (phppp or D.J.) - * @since Xoops 1.00 + * @copyright The XOOPS project http://www.xoops.org/ + * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPLv2 or later license + * @author Taiwen Jiang (phppp or D.J.) + * @since Xoops 1.00 * @package core */ +use ImpressCMS\Core\DataFilter; + xoops_header(false); $denied = true; @@ -182,8 +184,8 @@ $criteria = new icms_db_criteria_Compo(); foreach (array_keys($items_match) as $var) { if (!empty($_POST[$var])) { - $match = (!empty($_POST["{$var}_match"]))?(int) ($_POST["{$var}_match"]):XOOPS_MATCH_START; - $value = str_replace("_", "\\\_", icms_core_DataFilter::addSlashes(trim($_POST[$var]))); + $match = (!empty($_POST["{$var}_match"])) ? (int)($_POST["{$var}_match"]) : XOOPS_MATCH_START; + $value = str_replace("_", "\\\_", DataFilter::addSlashes(trim($_POST[$var]))); switch ($match) { case XOOPS_MATCH_START: $criteria->add(new icms_db_criteria_Item($var, $value . '%', 'LIKE')); @@ -207,14 +209,14 @@ } if (!empty($_POST['user_from'])) { - $criteria->add(new icms_db_criteria_Item('user_from', '%' . icms_core_DataFilter::addSlashes(trim($_POST['user_from'])) . '%', 'LIKE')); + $criteria->add(new icms_db_criteria_Item('user_from', '%' . DataFilter::addSlashes(trim($_POST['user_from'])) . '%', 'LIKE')); } if (!empty($_POST['user_intrest'])) { - $criteria->add(new icms_db_criteria_Item('user_intrest', '%' . icms_core_DataFilter::addSlashes(trim($_POST['user_intrest'])) . '%', 'LIKE')); + $criteria->add(new icms_db_criteria_Item('user_intrest', '%' . DataFilter::addSlashes(trim($_POST['user_intrest'])) . '%', 'LIKE')); } if (!empty($_POST['user_occ'])) { - $criteria->add(new icms_db_criteria_Item('user_occ', '%' . icms_core_DataFilter::addSlashes(trim($_POST['user_occ'])) . '%', 'LIKE')); + $criteria->add(new icms_db_criteria_Item('user_occ', '%' . DataFilter::addSlashes(trim($_POST['user_occ'])) . '%', 'LIKE')); } foreach (array("last_login", "user_regdate") as $var) { @@ -366,7 +368,7 @@ function addusers() // regenerate token value $hiddenform .= icms::$security->getTokenHTML() . "\n"; } else { - $hiddenform .= "\n"; + $hiddenform .= "\n"; } } @@ -452,7 +454,7 @@ function addusers() // regenerate token value $hiddenform .= icms::$security->getTokenHTML() . "\n"; } else { - $hiddenform .= "\n"; + $hiddenform .= "\n"; } } diff --git a/include/functions.php b/include/functions.php index 108afa317909..3bd7712baa6a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -36,6 +36,7 @@ */ use Aura\Session\Session; +use ImpressCMS\Core\DataFilter; use ImpressCMS\Core\Response\ViewResponse; if (!function_exists('xoops_header')) { @@ -796,7 +797,7 @@ function icms_purifyText($text, $keyword = false) $text = str_replace(' + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license LICENSE.txt + * @package core + * @since 1.1 + * @author modified by UnderDog */ +use ImpressCMS\Core\DataFilter; + $invite_form = new icms_form_Theme(_US_USERINVITE, "userinvite", "invite.php", "post", true); -$invite_form->addElement(new icms_form_elements_Text(_US_EMAIL, "email", 25, 60, icms_core_DataFilter::htmlSpecialChars($email)), true); +$invite_form->addElement(new icms_form_elements_Text(_US_EMAIL, "email", 25, 60, DataFilter::htmlSpecialChars($email)), true); $invite_form->addElement(new icms_form_elements_Captcha(_SECURITYIMAGE_GETCODE, "scode"), true); $invite_form->addElement(new icms_form_elements_Hidden("op", "finish")); $invite_form->addElement(new icms_form_elements_Button("", "submit", _US_SUBMIT, "submit")); \ No newline at end of file diff --git a/include/registerform.php b/include/registerform.php index 75bb6850f079..b71c2fb1dfa5 100644 --- a/include/registerform.php +++ b/include/registerform.php @@ -27,34 +27,36 @@ /** * Registration form * - * @copyright http://www.xoops.org/ The XOOPS Project - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license LICENSE.txt - * @package core - * @since XOOPS - * @author http://www.xoops.org The XOOPS Project + * @copyright http://www.xoops.org/ The XOOPS Project + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license LICENSE.txt + * @package core + * @since XOOPS + * @author http://www.xoops.org The XOOPS Project */ +use ImpressCMS\Core\DataFilter; + $email_tray = new icms_form_elements_Tray(_US_EMAIL, "
"); -$email_text = new icms_form_elements_Text("", "email", 25, 60, icms_core_DataFilter::htmlSpecialChars($email)); +$email_text = new icms_form_elements_Text("", "email", 25, 60, DataFilter::htmlSpecialChars($email)); $email_option = new icms_form_elements_Checkbox("", "user_viewemail", $user_viewemail); $email_option->addOption(1, _US_ALLOWVIEWEMAIL); $email_tray->addElement($email_text, true); $email_tray->addElement($email_option); $reg_form = new icms_form_Theme(_US_USERREG, "userinfo", "register.php", "post", true); -$uname_size = $icmsConfigUser['maxuname'] < 75?$icmsConfigUser['maxuname']:75; -$uname_size = $icmsConfigUser['maxuname'] > 3?$icmsConfigUser['maxuname']:3; -$reg_form->addElement(new icms_form_elements_Text(_US_NICKNAME, "uname", $uname_size, $uname_size, icms_core_DataFilter::htmlSpecialChars($uname)), true); -$login_name_size = $icmsConfigUser['maxuname'] < 75?$icmsConfigUser['maxuname']:75; -$reg_form->addElement(new icms_form_elements_Text(_US_LOGIN_NAME, "login_name", $login_name_size, $login_name_size, icms_core_DataFilter::htmlSpecialChars($login_name)), true); +$uname_size = $icmsConfigUser['maxuname'] < 75 ? $icmsConfigUser['maxuname'] : 75; +$uname_size = $icmsConfigUser['maxuname'] > 3 ? $icmsConfigUser['maxuname'] : 3; +$reg_form->addElement(new icms_form_elements_Text(_US_NICKNAME, "uname", $uname_size, $uname_size, DataFilter::htmlSpecialChars($uname)), true); +$login_name_size = $icmsConfigUser['maxuname'] < 75 ? $icmsConfigUser['maxuname'] : 75; +$reg_form->addElement(new icms_form_elements_Text(_US_LOGIN_NAME, "login_name", $login_name_size, $login_name_size, DataFilter::htmlSpecialChars($login_name)), true); $reg_form->addElement($email_tray); if ($icmsConfigUser['pass_level'] > 20) { icms_PasswordMeter(); } -$reg_form->addElement(new icms_form_elements_Password(_US_PASSWORD, "pass", 10, 255, icms_core_DataFilter::htmlSpecialChars($pass), false, ($icmsConfigUser['pass_level']?'password_adv':'')), true); -$reg_form->addElement(new icms_form_elements_Password(_US_VERIFYPASS, "vpass", 10, 255, icms_core_DataFilter::htmlSpecialChars($vpass)), true); -$reg_form->addElement(new icms_form_elements_Text(_US_WEBSITE, "url", 25, 255, icms_core_DataFilter::htmlSpecialChars($url))); -$tzselected = ($timezone_offset != "")?$timezone_offset:$icmsConfig['default_TZ']; +$reg_form->addElement(new icms_form_elements_Password(_US_PASSWORD, "pass", 10, 255, DataFilter::htmlSpecialChars($pass), false, ($icmsConfigUser['pass_level'] ? 'password_adv' : '')), true); +$reg_form->addElement(new icms_form_elements_Password(_US_VERIFYPASS, "vpass", 10, 255, DataFilter::htmlSpecialChars($vpass)), true); +$reg_form->addElement(new icms_form_elements_Text(_US_WEBSITE, "url", 25, 255, DataFilter::htmlSpecialChars($url))); +$tzselected = ($timezone_offset != "") ? $timezone_offset : $icmsConfig['default_TZ']; $reg_form->addElement(new icms_form_elements_select_Timezone(_US_TIMEZONE, "timezone_offset", $tzselected)); //$reg_form->addElement($avatar_tray); $reg_form->addElement(new icms_form_elements_Radioyn(_US_MAILOK, 'user_mailok', $user_mailok)); @@ -73,7 +75,7 @@ $reg_form->addElement($disc_tray); } -$reg_form->addElement(new icms_form_elements_Hidden("actkey", icms_core_DataFilter::htmlSpecialChars($actkey))); +$reg_form->addElement(new icms_form_elements_Hidden("actkey", DataFilter::htmlSpecialChars($actkey))); if ($icmsConfigUser['use_captcha'] == true) { $reg_form->addElement(new icms_form_elements_Captcha(_SECURITYIMAGE_GETCODE, "scode"), true); diff --git a/invite.php b/invite.php index 6672d554e44e..364e69183428 100644 --- a/invite.php +++ b/invite.php @@ -2,14 +2,16 @@ /** * All functions for Registering users by invitation are going through here. * - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license LICENSE.txt - * @package Member - * @subpackage Users - * @author marcan - * @author Sina Asghari (aka stranger) + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license LICENSE.txt + * @package Member + * @subpackage Users + * @author marcan + * @author Sina Asghari (aka stranger) */ +use ImpressCMS\Core\DataFilter; + $xoopsOption['pagetype'] = 'user'; // If not a user and invite needs one, redirect @@ -18,8 +20,8 @@ exit(); } -$op = !isset($_POST['op'])?'invite':$_POST['op']; -$email = isset($_POST['email'])? trim(icms_core_DataFilter::stripSlashesGPC($_POST['email'])):''; +$op = !isset($_POST['op']) ? 'invite' : $_POST['op']; +$email = isset($_POST['email']) ? trim(DataFilter::stripSlashesGPC($_POST['email'])) : ''; switch ($op) { case 'finish': diff --git a/lostpass.php b/lostpass.php index 649ee0f4e499..fd132f6a2518 100644 --- a/lostpass.php +++ b/lostpass.php @@ -29,14 +29,16 @@ * * Form and process for sending a new password to a user * - * @copyright http://www.xoops.org/ The XOOPS Project - * @copyright http://www.impresscms.org/ The ImpressCMS Project - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL) - * @package Member - * @subpackage Users - * @since XOOPS + * @copyright http://www.xoops.org/ The XOOPS Project + * @copyright http://www.impresscms.org/ The ImpressCMS Project + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL) + * @package Member + * @subpackage Users + * @since XOOPS */ +use ImpressCMS\Core\DataFilter; + $xoopsOption['pagetype'] = 'user'; /* $_POST parameters * email @@ -53,11 +55,11 @@ $code = ''; if (!empty($_GET)) { - $clean_GET = icms_core_DataFilter::checkVarArray($_GET, $filter_get, false); + $clean_GET = DataFilter::checkVarArray($_GET, $filter_get, false); extract($clean_GET); } if (!empty($_POST)) { - $clean_POST = icms_core_DataFilter::checkVarArray($_POST, $filter_post, false); + $clean_POST = DataFilter::checkVarArray($_POST, $filter_post, false); extract($clean_POST); } if ($email == '') { diff --git a/misc.php b/misc.php index 2487377ad812..7cd406a3bebd 100644 --- a/misc.php +++ b/misc.php @@ -36,6 +36,7 @@ */ use ImpressCMS\Core\DataFilter; +use ImpressCMS\Core\Models\User; icms_loadLanguageFile('core', 'misc'); /* set filter types, if not strings */ @@ -78,18 +79,13 @@ if ($target == '' || !preg_match('/^[0-9a-z_]*$/i', $target)) {} else { echo " - "; + var currentMessage = window.opener.xoopsGetElementById(\"" . $target . "\").value; + window.opener.xoopsGetElementById(\"" . $target . "; echo ' '; - $smiles = icms_core_DataFilter::getSmileys(1); + $smiles = DataFilter::getSmileys(1); $count = count($smiles); if ($count > 0) { $rcolor = 'even'; @@ -167,7 +163,7 @@ function showAvatar() { \n"; - echo _MSC_YOURNAMEC . " + echo _MSC_YOURNAMEC . " @@ -177,34 +173,34 @@ function showAvatar() { + " + . icms::$security->getTokenHTML() . "
'._MSC_SMILIES . '
'._MSC_CODE . '' . _MSC_EMOTION . '' . _IMAGE . '
" . _MSC_YOUREMAILC . "
    - " - . icms::$security->getTokenHTML() . "
\n"; - $closebutton = 0; + $closebutton = 0; } elseif ($op == 'sendsite') { - if (icms::$user) { - $ymail = icms::$user->email; - } else { - $ymail = isset($ymail)? icms_core_DataFilter::stripSlashesGPC(trim($ymail)):''; - } - if (!isset($yname) || trim($yname) == '' || $ymail == '' - || !isset($fname) || trim($fname) == '' - || !isset($fmail) || trim($fmail) == '') { - redirect_header(ICMS_URL . '/misc.php?action=showpopups&type=friend&op=sendform', 2, _MSC_NEEDINFO); - } - $yname = icms_core_DataFilter::stripSlashesGPC(trim($_POST['yname'])); - $fname = icms_core_DataFilter::stripSlashesGPC(trim($_POST['fname'])); - $fmail = icms_core_DataFilter::stripSlashesGPC(trim($_POST['fmail'])); - if (!checkEmail($fmail) || !checkEmail($ymail) || preg_match('/[\\0-\\31]/', $yname)) { - $errormessage = _MSC_INVALIDEMAIL1 . '
' . _MSC_INVALIDEMAIL2 . ''; - redirect_header(ICMS_URL . '/misc.php?action=showpopups&type=friend&op=sendform', 2, $errormessage); - } - global $icmsConfig; + if (icms::$user) { + $ymail = icms::$user->email; + } else { + $ymail = isset($ymail)? DataFilter::stripSlashesGPC(trim($ymail)):''; + } + if (!isset($yname) || trim($yname) == '' || $ymail == '' + || !isset($fname) || trim($fname) == '' + || !isset($fmail) || trim($fmail) == '') { + redirect_header(ICMS_URL . '/misc.php?action=showpopups&type=friend&op=sendform', 2, _MSC_NEEDINFO); + } + $yname = DataFilter::stripSlashesGPC(trim($_POST['yname'])); + $fname = DataFilter::stripSlashesGPC(trim($_POST['fname'])); + $fmail = DataFilter::stripSlashesGPC(trim($_POST['fmail'])); + if (!checkEmail($fmail) || !checkEmail($ymail) || preg_match('/[\\0-\\31]/', $yname)) { + $errormessage = _MSC_INVALIDEMAIL1 . '
' . _MSC_INVALIDEMAIL2 . ''; + redirect_header(ICMS_URL . '/misc.php?action=showpopups&type=friend&op=sendform', 2, $errormessage); + } + global $icmsConfig; - $mailer = new icms_messaging_Handler(); - $mailer->setTemplate('tellfriend.tpl'); - $mailer->assign('SITENAME', $icmsConfig['sitename']); - $mailer->assign('ADMINMAIL', $icmsConfig['adminmail']); + $mailer = new icms_messaging_Handler(); + $mailer->setTemplate('tellfriend.tpl'); + $mailer->assign('SITENAME', $icmsConfig['sitename']); + $mailer->assign('ADMINMAIL', $icmsConfig['adminmail']); $mailer->assign('SITEURL', ICMS_URL.'/'); $mailer->assign('YOUR_NAME', $yname); $mailer->assign('FRIEND_NAME', $fname); @@ -226,25 +222,29 @@ function showAvatar() { $criteria = new icms_db_criteria_Compo(); $criteria->setLimit($limit); $criteria->setStart($start); - $onlines = & $online_handler->getAll($criteria); + $onlines = &$online_handler->getAll($criteria); $count = count($onlines); $module_handler = icms::handler('icms_module'); - $modules = & $module_handler->getList(new icms_db_criteria_Item('isactive', 1)); - for ($i = 0; $i < $count; $i++) { - if ($onlines[$i]['online_uid'] == 0) { - $onlineUsers[$i]['user'] = ''; - } else { - $onlineUsers[$i]['user'] = new \ImpressCMS\Core\Models\User($onlines[$i]['online_uid']); - } - $onlineUsers[$i]['ip'] = $onlines[$i]['online_ip']; - $onlineUsers[$i]['updated'] = $onlines[$i]['online_updated']; - $onlineUsers[$i]['module'] = ($onlines[$i]['online_module'] > 0)?$modules[$onlines[$i]['online_module']]:''; + $modules = &$module_handler->getList(new icms_db_criteria_Item('isactive', 1)); + for ($i = 0; + $i < $count; + $i++) { + if ($onlines[$i]['online_uid'] == 0) { + $onlineUsers[$i]['user'] = ''; + } else { + $onlineUsers[$i]['user'] = new User($onlines[$i]['online_uid']); + } + $onlineUsers[$i]['ip'] = $onlines[$i]['online_ip']; + $onlineUsers[$i]['updated'] = $onlines[$i]['online_updated']; + $onlineUsers[$i]['module'] = ($onlines[$i]['online_module'] > 0)?$modules[$onlines[$i]['online_module']]:''; } $class = 'even'; - for ($i = 0; $i < $count; $i++) { - $class = ($class == 'odd')?'even':'odd'; - echo ''; - if (is_object($onlineUsers[$i]['user'])) { + for ($i = 0; + $i < $count; + $i++) { + $class = ($class == 'odd')?'even':'odd'; + echo ''; + if (is_object($onlineUsers[$i]['user'])) { $avatar = $onlineUsers[$i]['user']->user_avatar ?'':' '; echo '' . $avatar . " @@ -272,25 +272,25 @@ function showAvatar() { echo '
'; - $closebutton = false; + $closebutton = false; } break; - default: + default: break; } if ($closebutton) { - echo '
- + echo '
+
'; } xoops_footer(); - } + } - function printCheckForm() { + function printCheckForm() { ?>