forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trim filter to first, middle and lastname.
The additional trim form field data filter was created and added as input filter to the firstname, lastname and middlename fields of the customer_address and customer entities. Tickets: magento#10415
- Loading branch information
Showing
3 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
/** | ||
* Form Input/Output Trim Filter | ||
* | ||
* @author Magento Core Team <core@magentocommerce.com> | ||
*/ | ||
namespace Magento\Framework\Data\Form\Filter; | ||
|
||
class Trim implements \Magento\Framework\Data\Form\Filter\FilterInterface | ||
{ | ||
/** | ||
* Returns the result of filtering $value | ||
* | ||
* @param string $value | ||
* @return string | ||
*/ | ||
public function inputFilter($value) | ||
{ | ||
return trim($value, ' '); | ||
} | ||
|
||
/** | ||
* Returns the result of filtering $value | ||
* | ||
* @param string $value | ||
* @return string | ||
*/ | ||
public function outputFilter($value) | ||
{ | ||
return $value; | ||
} | ||
} |