Jump to content

Debug Mode With Bugs (Strlen() Expects Parameter 1 To Be String, Object Given On Line 54 In /{Blesta Instalation Root Path}/helpers/html/html.php)


PauloV

Recommended Posts

Hello :)

 


1- Describe the issue you're experiencing.

Re: There is a bug on some areas of Blesta that only shows wen enabling Debug Mode.

 

2- Provide detailed steps necessary to reproduce the issue.

Re: Wen enabling debug mode on blesta.php to


 

Configure::errorReporting(-1);

 

On, navigating in some settings like for exemple:

 

If you have eNom Module Installed (or any outher registrar module)

If you have a Domain Package added and active on one client ,and then on Blesta Admin, navigate to:

 

Clients->Browse->{click on a client with an Active eNom or outher Registrar Domain}->{Click on Manage on an Active Domain}->Whois

 

You will see that the page dosent parses and it sows the error:

 

strlen() expects parameter 1 to be string, object given on line 54 in /{blesta instalation root path}/helpers/html/html.php

 

I have reproduced this bug in several outher areas os Blesta 3.1.3 (dont remeber where :P, but is the same bug)


 

3- List any generated errors. (The "Oh Noes" error pages are very helpful.)

Re: strlen() expects parameter 1 to be string, object given on line 54 in /{blesta instalation root path}/helpers/html/html.php

 

4- Include the URL the error occurred on, relative to the installation path, ie "/admin/login".

Re: admin/clients/servicetab/1/2/tabWhois/

 

 

6- Include your configuration settings, i.e. OS, version of Blesta, version of module/gateway/plugin if applicable, version of PHP & MySQL.

Re: Blesta 3.1.3, PHP 5.3, MySQL 5.1.73

Link to comment
Share on other sites

I have traced the problem and Im adding the fix (for now the bug is only on Registrars Modules eNom, InternetBS).

 

The problem is wen no string is retuned, for exemple we have this code to populate Whois Fields:

				foreach ($whois_sections as $section) {

					if (isset($data->{$section})) {

						foreach ($data->{$section} as $name => $value) {
						  $vars->{ucfirst($section)."_".$name} = $value;
						}
					}

				}

and we add a simple string check (is_string) like this:

				foreach ($whois_sections as $section) {

					if (isset($data->{$section})) {

						foreach ($data->{$section} as $name => $value) {
                                                  if (!is_string($value)){$value = "";} // check if is string
						  $vars->{ucfirst($section)."_".$name} = $value;
						}
					}

				}

The problem is wen is empty fields wen retriving external data :)

 

Regards,

PV

Link to comment
Share on other sites

So you're able to duplicate this with eNom, but only when the data returned from the API contains empty fields? The error you described suggests it is an object rather than a string, at least when passed to the HTML helper:

 

strlen() expects parameter 1 to be string, object given on line 54 in /{blesta instalation root path}/helpers/html/html.php

 

 

Could you provide a response and var_dump of the eNom data causing the issue? I'd like to know why a non-string value is given.

Link to comment
Share on other sites

So you're able to duplicate this with eNom, but only when the data returned from the API contains empty fields? The error you described suggests it is an object rather than a string, at least when passed to the HTML helper:

 

 

 

Could you provide a response and var_dump of the eNom data causing the issue? I'd like to know why a non-string value is given.

 

Hello :)

 

I Have sent you a PM :)

 

Regards,

PV

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.

Loading...
×
×
  • Create New...