Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Tomy Tran on June 25, 2013, 07:50:16 AM

Title: Re: [2.1] Hooks in 2.1
Post by: Tomy Tran on June 25, 2013, 07:50:16 AM
Just translate some variables into Vietnamese today and found it got crazy working on my computer: When I turned into another page or even just refresh on SMF 2.1, the icon of loading in my browser appeared long long time and didn't stop loading.

Now check it and suddently open Task Manager found a list of cmd.exe and nslookup.exe running, search into SMF code, found this code from line 3505 to 3514 on Subs.php:

// This is nslookup; usually only Windows, but possibly some Unix?
if (!isset($host) && stripos(PHP_OS, 'win') !== false && strpos(strtolower(PHP_OS), 'darwin') === false && mt_rand(0, 1) == 1)
{
$test = @shell_exec('nslookup -timeout=1 ' . @escapeshellarg($ip));
if (strpos($test, 'Non-existent domain') !== false)
$host = '';
elseif (preg_match('~Name:\s+([^\s]+)~', $test, $match) == 1)
$host = $match[1];
}


When I make it be comment in PHP by put into /** */, it work fines with me and quickly loading a page. I installed SMF on localhost using USBwebserver 7.0 and my computer info:

QuoteYour Computer

Operating System:

Windows
NT 6.1 (Windows 7)

Current Browser / UA:

User Agent: Chrome 26.0.1410.12
Engine: AppleWebKit v: 537.31

Current Screen Resolution

1280 x 800 pixels

JavaScript

JavaScript is enabled.
Title: Re: Re: [2.1] Hooks in 2.1
Post by: NanoSector on June 25, 2013, 08:05:34 AM
Tomy, how exactly is this related to hooks in SMF 2.1?
Title: Re: Re: [2.1] Hooks in 2.1
Post by: emanuele on June 25, 2013, 08:55:43 AM
Quote from: Tomy Tran on June 25, 2013, 07:50:16 AM
Just translate some variables into Vietnamese today
What exactly did you translate?
Title: Bugs in 2.1
Post by: Tomy Tran on June 25, 2013, 09:10:23 AM
Oh, sorry I posted in wrong page because I have opened some pages at a time.

I believe this matter happened not relevant to translating. I have translated 2 files: Install.vietnamese.php & index.vietnamese.php
Title: Re: Re: [2.1] Hooks in 2.1
Post by: Arantor on December 20, 2013, 06:38:18 PM
So you have issues with your system and hostname lookups. This is not an SMF bug as such - you should disable hostname lookups on your local installation on your computer.