Post by straightlight » Mon Nov 14, 2011 11:45 pm

Hi,

I discovered a bug in admin/controller/common/home.php file.

Find:

Code: Select all

if (!file_exists($file)) {
    $this->data['errorlogs'] = sprintf($this->language->get('error_logs'). DIR_LOGS);
} else {
    $this->data['error_logs'] = '';
		
    unlink($file);
}
replace with:

Code: Select all

if (!file_exists($file)) {
    $this->data['error_logs'] = sprintf($this->language->get('error_logs'). DIR_LOGS, $file);
} else {
    $this->data['error_logs'] = '';
		
    unlink($file);
}
Two errors may return:

1 - From error_reporting (when executing manually), the 'errorlogs' key from $this->data will never be returned so the index will be undefined.

2 - The sprintf command requires two switch cases and not a single one. A sprintf server error message will be returned even though the error_reporting is disabled. The missing case was the $file variable.

Then, not a big issue, but your language output error_logs key returns one sentence at the end of the '!' mark.

In admin/language/english/common/home.php file,

find:

Code: Select all

$_['error_logs']                    = 'Warning: Log directory %snot writeable!';
replace with:

Code: Select all

$_['error_logs']                    = 'Warning: Log directory %snot writeable! ';
This will allow to separate the sentence between the exclamation mark and the next folder location in the sentence.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 12 guests