registrobr / whmcs-registrobr-epp

WHMCS Registrar Module for interfacing to Registro.br EPP
GNU General Public License v3.0
41 stars 21 forks source link

Possible redeclaration #51

Open registrobr opened 9 years ago

registrobr commented 9 years ago

Fatal error: Cannot redeclare class idna_convert in /home//public_html/core/modules/registrars/registrobr/Idna/idna_convert.class.php on line 54

Issue happened in a single installation, hasn't be reproduced. idna_convert is instanced with require_once so this shouldn't occur.

registrobr commented 9 years ago

Solving issue #38 might also address this issue, provided it's really an issue

rubenskuhl commented 9 years ago

Occurred in another installation. Fatal error: Cannot redeclare class idna_convert in /home//public_html/home/modules/registrars/registrobr/Idna/idna_convert.class.php on line 54

pablosbs commented 9 years ago

I fixed the issue replacing the follow code at the file RegistroEPP> RegistroEPP.class.php I changed the line : require_once('Idna/idna_convert.class.php'); to if (!class_exists('idna_convert')) require_once('Idna/idna_convert.class.php');

This change fixed the issue at my instalation.

rubenskuhl commented 9 years ago

Very good to know Pablo. Wasn't the purpose of "require_once" to do just that ? Just wondering whether other class declarations should have the same safeguards.