Jump to content

[NOT A BUG] custom server module - $result variable overwrite core variable


Recommended Posts

actually this is not a bug but i think you might want to look. it took 1 hour to figure out what s wrong for me :/

 

while creating a custom server module if you create a variable outside of any function, which's name is "$result", then you will get only one server's details in "admin/configservers.php" page in same server type, even though there's more than one.

 

modules/servers/test/test.php

<?php

$result = mysql_query('my own sql query');

function test_ConfigOptions(){

}

?>

 

in this scenerio if you add more than 1 server which's type "test", my $result variable overwrite whmc's core $result variable and system cant list other servers' details. may be you want to give an unique name to your $result variable(like $result_whmcscore) or add a note to module documentation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated