Skip to content

Commit d37b9a3

Browse files
committed
update from myTextSanitizer to icms_core_TextSanitizer
1 parent d5dbc0e commit d37b9a3

4 files changed

Lines changed: 22 additions & 20 deletions

File tree

class/art/functions.user.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
function mod_getIP($asString = false)
2727
{
2828
// Gets the proxy ip sent by the user
29-
/*$proxy_ip = '';
29+
$proxy_ip = '';
3030
if (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
3131
$proxy_ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
3232
} else if (!empty($_SERVER["HTTP_X_FORWARDED"])) {
@@ -44,26 +44,26 @@ function mod_getIP($asString = false)
4444
}
4545

4646
if (!empty($proxy_ip) &&
47-
$is_ip = (ereg('^([0-9]{1,3}\.){3,3}[0-9]{1,3}', $proxy_ip, $regs) &&
48-
count($regs) > 0)
47+
$is_ip = ereg('^([0-9]{1,3}\.){3,3}[0-9]{1,3}', $proxy_ip, $regs) &&
48+
count($regs) > 0
4949
) {
5050
$the_IP = $regs[0];
5151
}else{
5252
$the_IP = $_SERVER['REMOTE_ADDR'];
5353
}
5454

5555
$the_IP = ($asString) ? $the_IP : ip2long($the_IP);
56-
57-
*/
58-
return '0.0.0.0';
56+
57+
//return $the_IP;
58+
return ip2long('1.1.1.1');
5959
}
6060

6161
function &mod_getUnameFromIds( $uid, $usereal = false, $linked = false )
6262
{
6363
if (!is_array($uid)) $uid = array($uid);
6464
$userid = array_map("intval", array_filter($uid));
6565

66-
$myts = MyTextSanitizer::getInstance();
66+
$myts = icms_core_Textsanitizer::getInstance();
6767
$users = array();
6868
if (count($userid) > 0) {
6969
$sql = 'SELECT uid, uname, name FROM ' . $GLOBALS['xoopsDB']->prefix('users'). ' WHERE level>0 AND uid IN('.implode(",", array_unique($userid)).')';
@@ -91,8 +91,8 @@ function &mod_getUnameFromIds( $uid, $usereal = false, $linked = false )
9191

9292
function mod_getUnameFromId( $userid, $usereal = 0, $linked = false)
9393
{
94-
$myts = MyTextSanitizer::getInstance();
95-
$userid = (int)$userid;
94+
$myts = icms_core_Textsanitizer::getInstance();
95+
$userid = intval($userid);
9696
if ($userid > 0) {
9797
$member_handler = icms::handler('icms_member');
9898
$user = $member_handler->getUser($userid);
@@ -114,3 +114,4 @@ function mod_getUnameFromId( $userid, $usereal = 0, $linked = false)
114114
}
115115

116116
endif;
117+
?>

class/art/object.persistable.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ function __construct($table = null) {
3838
*/
3939
function getVar($key, $format = 's')
4040
{
41-
defined("MYTEXTSANITIZER_EXTENDED") || include_once ICMS_ROOT_PATH."/class/module.textsanitizer.php";
42-
$ts = MyTextSanitizer::getInstance();
41+
//defined("MYTEXTSANITIZER_EXTENDED") || include_once ICMS_ROOT_PATH."/class/module.textsanitizer.php";
42+
$ts = icms_core_Textsanitizer::getInstance();
4343
$ret = null;
4444
if ( !isset($this->vars[$key]) ) return $ret ;
4545
$ret = $this->vars[$key]['value'];
@@ -372,13 +372,14 @@ function &getAll($criteria = null, $tags = null, $asObject = true)
372372
*/
373373
function mysql_server_version($conn = null)
374374
{
375-
/*if (!is_null($conn)) {
376-
return mysql_get_server_info($conn);
377-
} else {
378-
return mysql_get_server_info();
379-
}*/
380-
return "6.0.0";
381-
375+
/*
376+
if (!is_null($conn)) {
377+
return mysql_get_server_info($conn);
378+
} else {
379+
return mysql_get_server_info();
380+
}
381+
*/
382+
return "6.0.0";
382383
}
383384

384385
/**

class/art/object.render.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function getList($criteria = null, $limit = 0, $start = 0)
149149
return $ret;
150150
}
151151

152-
$myts = MyTextSanitizer::getInstance();
152+
$myts = icms_core_Textsanitizer::getInstance();
153153
while ($myrow = icms::$xoopsDB->fetchArray($result)) {
154154
//identifiers should be textboxes, so sanitize them like that
155155
$ret[$myrow[$this->_handler->keyName]] = empty($this->_handler->identifierName) ? 1 : icms_core_DataFilter::htmlSpecialchars($myrow[$this->_handler->identifierName]);

class/art/object.write.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function &cleanVars(&$object)
4040
{
4141
$object->cleanVars();
4242
$changedVars = array();
43-
$ts = MyTextSanitizer::getInstance();
43+
$ts = icms_core_Textsanitizer::getInstance();
4444
foreach ($object->vars as $k => $v) {
4545
if(!$v["changed"]) continue;
4646
$cleanv = $object->cleanVars[$k];

0 commit comments

Comments
 (0)