2626function 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
6161function &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
9292function 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
116116endif ;
117+ ?>
0 commit comments