EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #00411
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Email MetaField validation
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: [EP-tech] Email MetaField validation
- From: Matthew Kerwin <matthew.kerwin@qut.edu.au>
- Date: Wed, 18 Apr 2012 16:10:50 +1000
In our ePrints installation we decided to make things a little easier on the human when importing eprints, by relaxing validation to allow leading and trailing whitespace. To accommodate this relaxation I modified EPrints::MetaField::Email, adding a form_value_basic method that subsequently strips said whitespace, thus: ---------- sub form_value_basic { my $self = shift; my $v = $self->SUPER::form_value_basic( @_ ); # strip leading and trailing whitespace $v =~ s/^\s+|\s+$//g; return $v; } ---------- Is this the right approach, or is there a better point where I can intercept the data before it hits our back-end store? And if this is the right place for sanitisation, should the method be patched in upstream? Further, is there a reason that any meta-field would ever want leading and trailing whitespace? Whatever approach ends up being used to sanitise the data, should it apply to all meta-fields, or just email? Cheers -- Matthew Kerwin | Web Developer | TILS | Digital Repository Team | Level 2, I Block, Kelvin Grove | ph 3138 3910 | matthew.kerwin@qut.edu.au | CRICOS No 00213J
- Follow-Ups:
- [EP-tech] Re: Email MetaField validation
- From: Tim Brody <tdb2@ecs.soton.ac.uk>
- [EP-tech] Re: Email MetaField validation
- References:
- [EP-tech] Google analytics
- From: <Gaston.Fournier@etsmtl.ca>
- [EP-tech] Re: Google analytics
- From: Mark Gregson <mark.gregson@qut.edu.au>
- [EP-tech] Re: Google analytics
- From: "Dimitrakakis Georgios" <giorgis@lib.uoc.gr>
- [EP-tech] Re: Google analytics
- From: Denis Pitzalis - STARC <d.pitzalis@cyi.ac.cy>
- [EP-tech] Re: Google analytics
- From: Mark Gregson <mark.gregson@qut.edu.au>
- [EP-tech] Google analytics
- Prev by Date: [EP-tech] Re: Google analytics
- Next by Date: [EP-tech] Re: Google analytics
- Previous by thread: [EP-tech] Re: Google analytics
- Next by thread: [EP-tech] Re: Email MetaField validation
- Index(es):