Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

Commit

Permalink
Prevent PHP (7) Error (#1)
Browse files Browse the repository at this point in the history
* Prevent PHP (7) Error

Solve error with strict standards: Only variables should be passed by reference

* Remove dimensions if any
  • Loading branch information
Cruiser13 authored and wendrowycz committed Aug 8, 2016
1 parent 40be81a commit 5ba6e23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/Twitter/Bootstrap3/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ public function addElement($element, $name = null, $options = null)
{
if ($element instanceof Zend_Form_Element) {
// type string
$type = lcfirst(trim(end(explode('_', $element->getType()))));
$exploderesult = explode('_', $element->getType());
$type = lcfirst(trim(end($exploderesult)));

if (null !== $options && $options instanceof Zend_Config) {
$options = $options->toArray();
Expand Down
5 changes: 5 additions & 0 deletions library/Twitter/Bootstrap3/Form/Decorator/ViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public function getElementAttribs()
unset($attribs['success']); // Twitter_Bootstrap3_Form_Decorator_Container
unset($attribs['warning']); // Twitter_Bootstrap3_Form_Decorator_Container

//Remove dimensions if any
unset($attribs['dimensionLabel']);
unset($attribs['dimensionControls']);
unset($attribs['dimension']);

return $attribs;
}
}

0 comments on commit 5ba6e23

Please sign in to comment.