[pLog-svn] BlogNameValidator() cause Chinese blog name error!
Mark Wu
markplace at gmail.com
Tue Sep 11 13:50:35 EDT 2007
Here come the code from AdminAddBlogAction()
=======================================
function AdminAddBlogAction( $actionInfo, $request )
{
$this->AdminAction( $actionInfo, $request );
// data validation
$this->registerFieldValidator( "blogName", new
BlogNameValidator());
$this->registerFieldValidator( "userId", new
IntegerValidator());
if( Subdomains::getSubdomainsEnabled()) {
$this->registerFieldValidator(
"blogSubDomain", new DomainValidator());
$this->registerFieldValidator(
"blogMainDomain", new DomainValidator());
}
$this->registerField( "userName" );
$view = new AdminCreateBlogView( $this->_blogInfo );
$view->setErrorMessage( $this->_locale->tr(
"error_adding_blog" ));
$this->setValidationErrorView( $view );
$this->requireAdminPermission( "add_site_blog" );
}
function perform()
{
// fetch the validated data
$this->_blogName =
Textfilter::filterAllHTML($this->_request->getValue( "blogName" ));
$this->_ownerId = $this->_request->getValue( "userId" );
$this->_blogProperties = $this->_request->getValue(
"properties" );
====================================
You can see we use the blogName with "filterAllHTML" ,....
So, no matter blogNameValidator or stringValidator, we only use the blog
name with "filterAllHTML" ...
Mark
> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
> Sent: Wednesday, September 12, 2007 1:42 AM
> To: LifeType Developer List
> Subject: Re: [pLog-svn] BlogNameValidator() cause Chinese
> blog name error!
>
> Check again:
>
> return(( Textfilter::domainize( Textfilter::filterAllHTML(
> $value ))) != "" );
>
>
> On Tue, 11 Sep 2007, Oscar Renalias wrote:
>
> > Why is BlogNameValidator the problem? I don't see any calls to
> > domainize() or urlize() in the code of the validator...
> >
> > On 11 Sep 2007, at 14:28, Mark Wu wrote:
> >
> >> Hi Oscar & Jon:
> >>
> >> It seems the new BlogNameValidator will cause some error when user
> >> enter Chinese blog name.
> >>
> >> I am still checking on it, it seems the new
> Textfilter::domanize() or
> >> Textfilter::urlize() casue the error.
> >>
> >> If I can not fix this bug, I will change it back to string
> validator
> >> if blog admin does not enable subdomain and blogdomain
> function. It
> >> can avoid this kind of problem.
> >>
> >> Mark
> >> _______________________________________________
> >> pLog-svn mailing list
> >> pLog-svn at devel.lifetype.net
> >> http://limedaley.com/mailman/listinfo/plog-svn
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://limedaley.com/mailman/listinfo/plog-svn
> >
>
> --
> Jon Daley
> http://jon.limedaley.com/
>
> Normal people believe that if it ain't broke,
> don't fix it.
> Engineers believe that if it ain't broke,
> it doesn't have enough features yet.
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
More information about the pLog-svn
mailing list