Skip to content

Commit

Permalink
Minor change to avoid duplicate error reporting
Browse files Browse the repository at this point in the history
Stop processing when finding errors in emails and
phone numbers.

Change-Id: If2c43b3aa4bdeeb04b3c36082a13bcf3650b9213
  • Loading branch information
mkroetzsch committed Aug 21, 2012
1 parent 7411251 commit 8811190
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/datavalues/SMW_DV_URI.php
Expand Up @@ -122,6 +122,7 @@ protected function parseUserValue( $value ) {
( preg_match( '<[-+./][-./]>', $hierpart ) ) ||
( !SMWURIValue::isValidTelURI( 'tel:' . $hierpart ) ) ) { /// TODO: introduce error-message for "bad" phone number
$this->addError( wfMsgForContent( 'smw_baduri', $this->m_wikitext ) );
return;
}
break;
case SMW_URI_MODE_EMAIL:
Expand All @@ -135,7 +136,7 @@ protected function parseUserValue( $value ) {
if ( !$check ) {
/// TODO: introduce error-message for "bad" email
$this->addError( wfMsgForContent( 'smw_baduri', $value ) );
break;
return;
}
$hierpart = str_replace( array( '%3A', '%2F', '%23', '%40', '%3F', '%3D', '%26', '%25' ), array( ':', '/', '#', '@', '?', '=', '&', '%' ), rawurlencode( $value ) );
}
Expand Down

0 comments on commit 8811190

Please sign in to comment.