Protected Member Functions | |
_beforeSave () |
Definition at line 28 of file Baseurl.php.
_beforeSave | ( | ) | [protected] |
Processing object before save data
If value is special ({{}}) we don't need add slash
Reimplemented from Mage_Core_Model_Abstract.
Definition at line 30 of file Baseurl.php.
00031 { 00032 $value = $this->getValue(); 00033 00034 if (!preg_match('#^{{((un)?secure_)?base_url}}#', $value)) { 00035 $parsedUrl = parse_url($value); 00036 if (!isset($parsedUrl['scheme']) || !isset($parsedUrl['host'])) { 00037 Mage::throwException(Mage::helper('core')->__('The %s you entered is invalid. Please make sure that it follows "http://domain.com/" format.', $this->getFieldConfig()->label)); 00038 } 00039 } 00040 00041 $value = rtrim($value, '/'); 00042 /** 00043 * If value is special ({{}}) we don't need add slash 00044 */ 00045 if (!preg_match('#}}$#', $value)) { 00046 $value.= '/'; 00047 } 00048 00049 00050 $this->setValue($value); 00051 return $this; 00052 }