SMF 2.1.3 has been released! Take it for a spin! Read more.

Main Menu

Re: [2.1] Hooks in 2.1

Started by Tomy Tran, June 25, 2013, 07:50:16 AM

Previous topic - Next topic

Tomy Tran

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:

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 is enabled.


Tomy, how exactly is this related to hooks in SMF 2.1?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."


Quote from: Tomy Tran on June 25, 2013, 07:50:16 AM
Just translate some variables into Vietnamese today
What exactly did you translate?

Take a peek at what I'm doing! ;D

Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Tomy Tran

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


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.