1
wishcraft
X-Torrent: Invalid Passkey or Secret

Hi everybody there is a function within X-Torrent for generating an error, I am current writting this from RC (Final) to Official.. You may have noticed in the SVN... well for those that are having secret issues there is 2 things to do, change the passkey fields to a length of 255, as well as the secret field to 140... Making sure there is room for the variable length... You will also have to change this function:

Remember the internet is a vast place.. This will fold to where you need it most... no zeros, please...

You will need to change this function in the /include/functions.php

function xtorrent_get_base_domain($url
{
      static 
$sdomain;
    
    if (!
strpos($url"://"))
        
$url "tcp://".$url;
    
    
$parsed_url parse_url($url);
    
    if (
strpos(" ".$parsed_url['host'],$sdomain))
        return 
$sdomain;
            
    
// break up domain, reverse
    
$domain explode('.'$parsed_url['host']);
    
$domain array_reverse($domain);
    
    
// first check for ip address
    
if ( count($domain) == && is_numeric($domain[0]) && is_numeric($domain[3]) )
    {
      return 
implode('.'$domain);
    }
    
    
// if only 2 domain parts, that must be our domain
    
if ( count($domain) <= ) {
        
$sdomain $parsed_url['host'];
        return 
$sdomain;
    }
    
      
$OEG_TLD = array(
        
'biz','com','edu','gov','info','int','mil','name','net','org',
        
'aero','asia','cat','coop','jobs','mobi','museum','pro','tel','travel',
        
'arpa','root','berlin','bzh','cym','gal','geo','kid','kids','lat','mail',
        
'nyc','post','sco','web','xxx','nato''example','invalid','localhost','test',
        
'bitnet','csnet','ip','local','onion','uucp','geek','co','go','spy','travel','int','asia'
      
);
  
  
// country tlds (source: http://en.wikipedia.org/wiki/Country_code_top-level_domain)
     
$OE_TLD = array(
    
// active
        
'ac','ad','ae','af','ag','ai','al','am','an','ao','aq','ar','as','at','au','aw','ax','az',
        
'ba','bb','bd','be','bf','bg','bh','bi','bj','bm','bn','bo','br','bs','bt','bw','by','bz',
        
'ca','cc','cd','cf','cg','ch','ci','ck','cl','cm','cn','co','cr','cu','cv','cx','cy','cz',
        
'de','dj','dk','dm','do','dz','ec','ee','eg','er','es','et','eu','fi','fj','fk','fm','fo',
        
'fr','ga','gd','ge','gf','gg','gh','gi','gl','gm','gn','gp','gq','gr','gs','gt','gu','gw',
        
'gy','hk','hm','hn','hr','ht','hu','id','ie','il','im','in','io','iq','ir','is','it','je',
        
'jm','jo','jp','ke','kg','kh','ki','km','kn','kr','kw','ky','kz','la','lb','lc','li','lk',
        
'lr','ls','lt','lu','lv','ly','ma','mc','md','mg','mh','mk','ml','mm','mn','mo','mp','mq',
        
'mr','ms','mt','mu','mv','mw','mx','my','mz','na','nc','ne','nf','ng','ni','nl','no','np',
        
'nr','nu','nz','om','pa','pe','pf','pg','ph','pk','pl','pn','pr','ps','pt','pw','py','qa',
        
're','ro','ru','rw','sa','sb','sc','sd','se','sg','sh','si','sk','sl','sm','sn','sr','st',
        
'sv','sy','sz','tc','td','tf','tg','th','tj','tk','tl','tm','tn','to','tr','tt','tv','tw',
        
'tz','ua','ug','uk','us','uy','uz','va','vc','ve','vg','vi','vn','vu','wf','ws','ye','yu',
        
'za','zm','zw','io','eh','kp','me','rs','um','bv','gb','pm','sj','so','yt','su','tp',
        
'bu','cs','dd','zr'
    
);
    
    if ( 
in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD) && $domain[2] != 'www' )
    {
        
$sdomain $domain[2] . '.' $domain[1] . '.' $domain[0];
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD))
    {
        
$sdomain $domain[1] . '.' $domain[0];
        return 
$sdomain;
    }

    
$A_TLD = array();
    
$first ="a";  
    for (
$i=0;$i<26;$i++)
    {
        
$second ="a";
        for (
$j=0;$j<26;$j++)
        {
            
$A_TLD[] = $first.$second;
            if (
strlen('us')>2) {
                
$third "a";
                for (
$c=0;$c<26;$c++)
                {
                    
$A_TLD[] = $first.$second.$third;
                    if (
strlen('mil')>3) {
                        
$forth "a";
                        for (
$l=0;$l<26;$l++)
                        {
                            
$A_TLD[] = $first.$second.$third.forth;
                            
$forth++;
                    }}
                
$third++;
            }}
            
$second++;        
        }
        
$first++;
    }
    
    
$first ="a";  
    for (
$i=0;$i<26;$i++)
    {
        if (
strlen('localhost')>1) {
        
$second ="a";
        for (
$j=0;$j<26;$j++)
        {
            
$C_TLD[] = $first.$second;
            if (
strlen('localhost')>2) {
            
$third "a";
            for (
$c=0;$c<26;$c++)
            {
                
$C_TLD[] = $first.$second.$third;
                if (
strlen('localhost')>3) {
                
$forth "a";
                for (
$v=0;$v<26;$v++)
                {
                    
$C_TLD[] = $first.$second.$third.$forth;
                    if (
strlen('localhost')>4) {                    
                    
$fifth "a";
                    for (
$x=0;$x<26;$x++)
                    {
                        
$C_TLD[] = $first.$second.$third.$forth.$fifth;
                        if (
strlen('localhost')>5) {                        
                        
$sixth "a";
                        for (
$x=0;$x<26;$x++)
                        {
                            
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth;
                            if (
strlen('localhost')>6) {                            
                            
$seventh "a";
                            for (
$x=0;$x<26;$x++) {
                                
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh;
                                if (
strlen('localhost')>7) {                            
                                
$eigth "a";
                                for (
$x=0;$x<26;$x++)
                                {
                                    
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh.$eigth;
                                    if (
strlen('localhost')>8) {                            
                                    
$ninth "a";
                                    for (
$x=0;$x<26;$x++)
                                    {
                                        
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh.$eigth.$ninth;
                                        if (
strlen('localhost')>9) {                            
                                        
$tenth "a";
                                        for (
$x=0;$x<26;$x++)
                                        {
                                            
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh.$eigth.$ninth.$tenth;                            
                                            
$tenth++;
                                        }}                                                            
                                        
$ninth++;
                                    }}                                        
                                    
$eigth++;
                                }}
                                
$seventh++;
                            }}                                        
                            
$sixth++;
                        }}            
                        
$fifth++;
                    }}            
                    
$forth++;
                }}
                
$third++;
            }}
            
$second++;        
        }
                
        if ( 
in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD) && $domain[2] != 'www' )
        {
            
$sdomain $domain[2] . '.' $domain[1] . '.' $domain[0];
            return 
$sdomain;
        }
        elseif ( 
in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD))
        {
            
$sdomain $domain[1] . '.' $domain[0];
            return 
$sdomain;
        }

        unset(
$C_TLD);
        
$C_TLD=array();            
        }
        
$first++;
    }

    
$sdomain str_replace("www.","",$parsed_url['host']);
    return 
$sdomain;
}
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

2
wishcraft
Re: X-Torrent: Invalid Passkey or Secret

opps minor error

if (strpos(" ".$parsed_url['host'],$sdomain))
        return 
$parsed_url;


changes to

if (strpos(" ".$parsed_url['host'],$sdomain))
        return 
$sdomain;
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

3
wishcraft
Re: X-Torrent: Invalid Passkey or Secret

Actually that code previously has a code construct problem..

### Author Simon Roberts [wishcraft/morph]

function xtorrent_get_base_url($url)
{

      static 
$sdomain;
    
    if (!
strpos($url"://"))
        
$url "tcp://".$url;
    
    
$parsed_url parse_url($url);
    
    if (
strpos(" ".$parsed_url['host'],$sdomain))
        return 
$sdomain;
            
    
// break up domain, reverse
    
$domain explode('.'$parsed_url['host']);
    
$domain array_reverse($domain);
    
    
// first check for ip address
    
if ( count($domain) == && is_numeric($domain[0]) && is_numeric($domain[3]) )
    {
      return 
implode('.'$domain);
    }
    
    
// if only 2 domain parts, that must be our domain
    
if ( count($domain) <= ) {
        
$sdomain strtolower($parsed_url['host']);
        return 
$sdomain;
    }
    
      
$OEG_TLD = array(
        
'biz','com','edu','gov','info','int','mil','name','net','org',
        
'aero','asia','cat','coop','jobs','mobi','museum','pro','tel','travel',
        
'arpa','root','berlin','bzh','cym','gal','geo','kid','kids','lat','mail',
        
'nyc','post','sco','web','xxx','nato''example','invalid','localhost','test',
        
'bitnet','csnet','ip','localhost','onion','uucp','geek','co','go','spy','travel','int','asia'
      
);
  
  
// country tlds (source: http://en.wikipedia.org/wiki/Country_code_top-level_domain)
     
$OE_TLD = array(
    
// active
        
'ac','ad','ae','af','ag','ai','al','am','an','ao','aq','ar','as','at','au','aw','ax','az',
        
'ba','bb','bd','be','bf','bg','bh','bi','bj','bm','bn','bo','br','bs','bt','bw','by','bz',
        
'ca','cc','cd','cf','cg','ch','ci','ck','cl','cm','cn','co','cr','cu','cv','cx','cy','cz',
        
'de','dj','dk','dm','do','dz','ec','ee','eg','er','es','et','eu','fi','fj','fk','fm','fo',
        
'fr','ga','gd','ge','gf','gg','gh','gi','gl','gm','gn','gp','gq','gr','gs','gt','gu','gw',
        
'gy','hk','hm','hn','hr','ht','hu','id','ie','il','im','in','io','iq','ir','is','it','je',
        
'jm','jo','jp','ke','kg','kh','ki','km','kn','kr','kw','ky','kz','la','lb','lc','li','lk',
        
'lr','ls','lt','lu','lv','ly','ma','mc','md','mg','mh','mk','ml','mm','mn','mo','mp','mq',
        
'mr','ms','mt','mu','mv','mw','mx','my','mz','na','nc','ne','nf','ng','ni','nl','no','np',
        
'nr','nu','nz','om','pa','pe','pf','pg','ph','pk','pl','pn','pr','ps','pt','pw','py','qa',
        
're','ro','ru','rw','sa','sb','sc','sd','se','sg','sh','si','sk','sl','sm','sn','sr','st',
        
'sv','sy','sz','tc','td','tf','tg','th','tj','tk','tl','tm','tn','to','tr','tt','tv','tw',
        
'tz','ua','ug','uk','us','uy','uz','va','vc','ve','vg','vi','vn','vu','wf','ws','ye','yu',
        
'za','zm','zw','io','eh','kp','me','rs','um','bv','gb','pm','sj','so','yt','su','tp',
        
'bu','cs','dd','zr'
    
);
    
    if ( 
in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD) && $domain[2] != 'www' )
    {
        
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD))
    {
        
$sdomain strtolower($domain[2] . '.' .$domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OE_TLD))
    {
        
$sdomain strtolower($domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }

    
    
$A_TLD = array();
    
$first ="a";  
    for (
$i=0;$i<26;$i++)
    {
        
$second ="a";
        for (
$j=0;$j<26;$j++)
        {
            
$A_TLD[] = $first.$second;
            if (
strlen('us')>2) {
                
$third "a";
                for (
$c=0;$c<26;$c++)
                {
                    
$A_TLD[] = $first.$second.$third;
                    if (
strlen('mil')>3) {
                        
$forth "a";
                        for (
$l=0;$l<26;$l++)
                        {
                            
$A_TLD[] = $first.$second.$third.forth;
                            
$forth++;
                    }}
                
$third++;
            }}
            
$second++;        
        }
        
$first++;
    }
    
    
$first ="a";  
    for (
$i=0;$i<26;$i++)
    {
        if (
strlen('localhost')>1) {
        
$second ="a";
        for (
$j=0;$j<26;$j++)
        {
            
$C_TLD[] = $first.$second;
            if (
strlen('localhost')>2) {
            
$third "a";
            for (
$c=0;$c<26;$c++)
            {
                
$C_TLD[] = $first.$second.$third;
                if (
strlen('localhost')>3) {
                
$forth "a";
                for (
$v=0;$v<26;$v++)
                {
                    
$C_TLD[] = $first.$second.$third.$forth;
                    if (
strlen('localhost')>4) {                    
                    
$fifth "a";
                    for (
$x=0;$x<26;$x++)
                    {
                        
$C_TLD[] = $first.$second.$third.$forth.$fifth;
                        if (
strlen('localhost')>5) {                        
                        
$sixth "a";
                        for (
$x=0;$x<26;$x++)
                        {
                            
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth;
                            if (
strlen('localhost')>6) {                            
                            
$seventh "a";
                            for (
$x=0;$x<26;$x++) {
                                
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh;
                                if (
strlen('localhost')>7) {                            
                                
$eigth "a";
                                for (
$x=0;$x<26;$x++)
                                {
                                    
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh.$eigth;
                                    if (
strlen('localhost')>8) {                            
                                    
$ninth "a";
                                    for (
$x=0;$x<26;$x++)
                                    {
                                        
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh.$eigth.$ninth;
                                        if (
strlen('localhost')>9) {                            
                                        
$tenth "a";
                                        for (
$x=0;$x<26;$x++)
                                        {
                                            
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh.$eigth.$ninth.$tenth;                            
                                            
$tenth++;
                                        }}                                                            
                                        
$ninth++;
                                    }}                                        
                                    
$eigth++;
                                }}
                                
$seventh++;
                            }}                                        
                            
$sixth++;
                        }}            
                        
$fifth++;
                    }}            
                    
$forth++;
                }}
                
$third++;
            }}
            
$second++;        
        }
                
        if ( 
in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD) && $domain[2] != 'www' )
        {
            
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }
        elseif ( 
in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD))
        {
            
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }
        elseif ( 
in_array($domain[0], $A_TLD))
        {
            
$sdomain strtolower($domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }

        unset(
$C_TLD);
        
$C_TLD=array();            
        }
        
$first++;
    }

    
$sdomain strtolower(str_replace("www.","",$parsed_url['host']));
    return 
$sdomain;
}


The if statements has changes

ie..

if ( in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD) && $domain[2] != 'www' 
        { 
            
$sdomain $domain[2] . '.' $domain[1] . '.' $domain[0]; 
            return 
$sdomain
        } 
        elseif ( 
in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD)) 
        { 
            
$sdomain $domain[1] . '.' $domain[0]; 
            return 
$sdomain
        } 

### changed to ###

        
if ( in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD) && $domain[2] != 'www' )
        {
            
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }
        elseif ( 
in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD))
        {
            
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }
        elseif ( 
in_array($domain[0], $A_TLD))
        {
            
$sdomain strtolower($domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }


You will be getting a time out error.
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

4
wishcraft
Sorry I am being asked to post this one this way ;l-)

Ok this is the official (xtorrent_get_base_url/xoops_base_url) function.. I was asked in a previous impression to error this one til the 3rd post.. ;-v sorry for those, but anyone with just a good knowledge of PHP should have seen this...

#####################
# Function xoops_base_domain
# Author: Simon Roberts [wishcraft]
# @arg url string
# @return base domain of url
#####################

// function xtorrent_get_base_domain($url) 
function xoops_base_domain($url
{
      static 
$sdomain;
    
    if (!
strpos($url"://"))
        
$url "tcp://".$url;
    
    
$parsed_url parse_url($url);
    
    if (
strpos(" ".$parsed_url['host'],$sdomain))
        return 
$sdomain;
            
    
// break up domain, reverse
    
$domain explode('.'$parsed_url['host']);
    
$domain array_reverse($domain);
    
    
// first check for ip address
    
if ( count($domain) == && is_numeric($domain[0]) && is_numeric($domain[3]) )
    {
      return 
implode('.'$domain);
    }
    
    
// if only 2 domain parts, that must be our domain
    
if ( count($domain) <= ) {
        
$sdomain strtolower($parsed_url['host']);
        return 
$sdomain;
    }
    
      
$OEG_TLD = array(
        
'biz','com','edu','gov','info','int','mil','name','net','org',
        
'aero','asia','cat','coop','jobs','mobi','museum','pro','tel','travel',
        
'arpa','root','berlin','bzh','cym','gal','geo','kid','kids','lat','mail',
        
'nyc','post','sco','web','xxx','nato''example','invalid','localhost','test',
        
'bitnet','csnet','ip','localhost','onion','uucp','geek','co','go','spy','travel','int','asia'
      
);
  
  
// country tlds (source: http://en.wikipedia.org/wiki/Country_code_top-level_domain)
     
$OE_TLD = array(
    
// active
        
'ac','ad','ae','af','ag','ai','al','am','an','ao','aq','ar','as','at','au','aw','ax','az',
        
'ba','bb','bd','be','bf','bg','bh','bi','bj','bm','bn','bo','br','bs','bt','bw','by','bz',
        
'ca','cc','cd','cf','cg','ch','ci','ck','cl','cm','cn','co','cr','cu','cv','cx','cy','cz',
        
'de','dj','dk','dm','do','dz','ec','ee','eg','er','es','et','eu','fi','fj','fk','fm','fo',
        
'fr','ga','gd','ge','gf','gg','gh','gi','gl','gm','gn','gp','gq','gr','gs','gt','gu','gw',
        
'gy','hk','hm','hn','hr','ht','hu','id','ie','il','im','in','io','iq','ir','is','it','je',
        
'jm','jo','jp','ke','kg','kh','ki','km','kn','kr','kw','ky','kz','la','lb','lc','li','lk',
        
'lr','ls','lt','lu','lv','ly','ma','mc','md','mg','mh','mk','ml','mm','mn','mo','mp','mq',
        
'mr','ms','mt','mu','mv','mw','mx','my','mz','na','nc','ne','nf','ng','ni','nl','no','np',
        
'nr','nu','nz','om','pa','pe','pf','pg','ph','pk','pl','pn','pr','ps','pt','pw','py','qa',
        
're','ro','ru','rw','sa','sb','sc','sd','se','sg','sh','si','sk','sl','sm','sn','sr','st',
        
'sv','sy','sz','tc','td','tf','tg','th','tj','tk','tl','tm','tn','to','tr','tt','tv','tw',
        
'tz','ua','ug','uk','us','uy','uz','va','vc','ve','vg','vi','vn','vu','wf','ws','ye','yu',
        
'za','zm','zw','io','eh','kp','me','rs','um','bv','gb','pm','sj','so','yt','su','tp',
        
'bu','cs','dd','zr'
    
);
    
    if ( 
in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD) && $domain[2] != 'www' )
    {
        
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD))
    {
        
$sdomain strtolower($domain[2] . '.' .$domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OEG_TLD))
    {
        
$sdomain strtolower($domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OE_TLD))
    {
        
$sdomain strtolower($domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }

    
    
$A_TLD = array();
    
$first ="a";  
    for (
$i=0;$i<26;$i++)
    {
        
$second ="a";
        for (
$j=0;$j<26;$j++)
        {
            
$A_TLD[] = $first.$second;
            if (
strlen('us')>2) {
                
$third "a";
                for (
$c=0;$c<26;$c++)
                {
                    
$A_TLD[] = $first.$second.$third;
                    if (
strlen('mil')>3) {
                        
$forth "a";
                        for (
$l=0;$l<26;$l++)
                        {
                            
$A_TLD[] = $first.$second.$third.forth;
                            
$forth++;
                    }}
                
$third++;
            }}
            
$second++;        
        }
        
$first++;
    }
    
    
$first ="a";  
    for (
$i=0;$i<26;$i++)
    {
        if (
strlen('localhost')>1) {
        
$second ="a";
        for (
$j=0;$j<26;$j++)
        {
            
$C_TLD[] = $first.$second;
            if (
strlen('localhost')>2) {
            
$third "a";
            for (
$c=0;$c<26;$c++)
            {
                
$C_TLD[] = $first.$second.$third;
                if (
strlen('localhost')>3) {
                
$forth "a";
                for (
$v=0;$v<26;$v++)
                {
                    
$C_TLD[] = $first.$second.$third.$forth;
                    if (
strlen('localhost')>4) {                    
                    
$fifth "a";
                    for (
$x=0;$x<26;$x++)
                    {
                        
$C_TLD[] = $first.$second.$third.$forth.$fifth;
                        if (
strlen('localhost')>5) {                        
                        
$sixth "a";
                        for (
$x=0;$x<26;$x++)
                        {
                            
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth;
                            if (
strlen('localhost')>6) {                            
                            
$seventh "a";
                            for (
$x=0;$x<26;$x++) {
                                
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh;
                                if (
strlen('localhost')>7) {                            
                                
$eigth "a";
                                for (
$x=0;$x<26;$x++)
                                {
                                    
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh.$eigth;
                                    if (
strlen('localhost')>8) {                            
                                    
$ninth "a";
                                    for (
$x=0;$x<26;$x++)
                                    {
                                        
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh.$eigth.$ninth;
                                        if (
strlen('localhost')>9) {                            
                                        
$tenth "a";
                                        for (
$x=0;$x<26;$x++)
                                        {
                                            
$C_TLD[] = $first.$second.$third.$forth.$fifth.$sixth.$seventh.$eigth.$ninth.$tenth;                            
                                            
$tenth++;
                                        }}                                                            
                                        
$ninth++;
                                    }}                                        
                                    
$eigth++;
                                }}
                                
$seventh++;
                            }}                                        
                            
$sixth++;
                        }}            
                        
$fifth++;
                    }}            
                    
$forth++;
                }}
                
$third++;
            }}
            
$second++;        
        }
                
        if ( 
in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD) && $domain[2] != 'www' )
        {
            
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }
        elseif ( 
in_array($domain[0], $A_TLD) && in_array($domain[1], $C_TLD))
        {
            
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }
        elseif ( 
in_array($domain[0], $C_TLD))
        {
            
$sdomain strtolower($domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }
        elseif ( 
in_array($domain[0], $A_TLD))
        {
            
$sdomain strtolower($domain[1] . '.' $domain[0]);
            return 
$sdomain;
        }

        unset(
$C_TLD);
        
$C_TLD=array();            
        }
        
$first++;
    }

    
$sdomain strtolower(str_replace("www.","",$parsed_url['host']));
    return 
$sdomain;
}


has changed to...

## previously

    
if ( in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD) && $domain[2] != 'www' )
    {
        
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD))
    {
        
$sdomain strtolower($domain[2] . '.' .$domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OE_TLD))
    {
        
$sdomain strtolower($domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }

## IF Statement construct
    
if ( in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD) && $domain[2] != 'www' )
    {
        
$sdomain strtolower($domain[2] . '.' $domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OE_TLD) && in_array($domain[1], $OEG_TLD))
    {
        
$sdomain strtolower($domain[2] . '.' .$domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OEG_TLD))
    {
        
$sdomain strtolower($domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }
    elseif ( 
in_array($domain[0], $OE_TLD))
    {
        
$sdomain strtolower($domain[1] . '.' $domain[0]);
        return 
$sdomain;
    }

Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

5
LordPeter
Re: Sorry I am being asked to post this one this way ;l-)
  • 2008/10/15 7:51

  • LordPeter

  • Just popping in

  • Posts: 48

  • Since: 2008/2/29


Hi WC
I adjust the function.php in modules/xtorrent/include like you wrote, after adjusting the value it gives the next error:
Fatal error: Call to undefined function xtorrent_get_base_domain() in /usr/home/******/domains/******.**/public_html/modules/xtorrent/visit.php on line 102

i see in my visit.php on line 102 :
$sql = "select id, passkey from ".$xoopsDB->prefix('xtorrent_users'). " where username='".$uname."' and uid='".$uid."' and lid = $lid and secret = sha1('".xtorrent_get_base_domain(gethostbyaddr($_SERVER['REMOTE_ADDR']))."') and enabled = 'yes'";

What do i have to change in here.....
Greets,
LP

6
ghia
Re: X-Torrent: Invalid Passkey or Secret
  • 2008/10/15 9:45

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
// function xtorrent_get_base_domain($url) 
function xoops_base_domain($url)

Did you notice the name change?

Login

Who's Online

276 user(s) are online (197 user(s) are browsing Support Forums)


Members: 0


Guests: 276


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits