CMS MADE SIMPLE FORGE

Gallery

 

[#12005] PHP Notice when JavaScript field in template is not filled in

avatar
Created By: Deleted User (deleteduser_11200)
Date Submitted: Fri Mar 29 05:44:34 -0400 2019

Assigned To: Jos (josvd)
Version: 2.3.2
CMSMS Version: 2.2.10
Severity: Minor
Resolution: Fixed
State: Closed
Summary:
PHP Notice when JavaScript field in template is not filled in
Detailed Description:
PHP message: PHP Notice:  Undefined offset: 2 in
/path/public/modules/Gallery/action.default.php on line 377\n'

How to reproduct:

- Login to: /admin
- Go to: Content -> Gallery [Templates]-tab
- add or edit template  
- Leave: "Template JavaScript:" empty
- Call {Gallery} tag and watch Apache error logs


How to solve:

Change:

	$template_js = trim(substr($templatecodearr[2], 0, -2));

Into:

$template_js = isset($templatecodearr[2]) ? trim(substr($templatecodearr[2], 0,
-2)) : '';


History

Comments
avatar
Date: 2019-07-04 18:16
Posted By: Jos (josvd)

thanks, fixed in version 2.3.3
      
Updates

Updated: 2019-07-04 18:16
resolution_id: => 7
state: Open => Closed