Advertisement:

Author Topic: Re: [2.1] Hooks in 2.1  (Read 4631 times)

Offline Tomy Tran

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 317
  • Gender: Male
  • Vietnamese Translator
    • the.tomytran on Facebook
    • tomytran on LinkedIn
    • @_tomytran on Twitter
    • Call to +84 9 0602 6930 or visit www.tomytran.com
Re: [2.1] Hooks in 2.1
« 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:

Code: [Select]
// 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:

Quote
Your 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.

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,499
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Re: [2.1] Hooks in 2.1
« Reply #1 on: June 25, 2013, 08:05:34 AM »
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."

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Re: [2.1] Hooks in 2.1
« Reply #2 on: June 25, 2013, 08:55:43 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.

Offline Tomy Tran

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 317
  • Gender: Male
  • Vietnamese Translator
    • the.tomytran on Facebook
    • tomytran on LinkedIn
    • @_tomytran on Twitter
    • Call to +84 9 0602 6930 or visit www.tomytran.com
Bugs in 2.1
« Reply #3 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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 70,939
    • StoryBB/StoryBB on GitHub
Re: Re: [2.1] Hooks in 2.1
« Reply #4 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.