Skip to content
Snippets Groups Projects
Commit b7ae2d56 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

remove white space after ?>

parent ceda8aa7
1 merge request!393Master
......@@ -16,20 +16,20 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_Validate_Isbn extends Zend_Validate_Abstract {
const INVALID_ISBN = 'invalidIsbn';
protected $_messageTemplates = array(self::INVALID_ISBN => "'%value%' n'est pas un ISBN valide");
public function isValid($value) {
if ('' === $valueString = preg_replace('/[\s\.\-\_]/', '', (string)$value))
return true;
$this->_setValue($valueString);
if ($this->isISBN10Valid($valueString) || $this->isISBN13Valid($valueString))
if ($this->isISBN10Valid($valueString) || $this->isISBN13Valid($valueString))
return true;
$this->_error(self::INVALID_ISBN);
......@@ -50,7 +50,7 @@ class ZendAfi_Validate_Isbn extends Zend_Validate_Abstract {
public function isISBN10Valid($ISBN10){
if(strlen($ISBN10) != 10)
return false;
$a = 0;
for($i = 0; $i < 10; $i++){
if ($ISBN10[$i] == "X"){
......@@ -60,5 +60,4 @@ class ZendAfi_Validate_Isbn extends Zend_Validate_Abstract {
return ($a % 11 == 0);
}
}
?>
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment