[pLog-svn] r6687 - plog/branches/lifetype-1.2/class/data/validator

mark at devel.lifetype.net mark at devel.lifetype.net
Tue Jul 1 01:37:16 EDT 2008


Author: mark
Date: 2008-07-01 01:37:16 -0400 (Tue, 01 Jul 2008)
New Revision: 6687

Modified:
   plog/branches/lifetype-1.2/class/data/validator/blognamevalidator.class.php
Log:
1. nohtmlrule.class.php should be include before use it.

2. Only use domainize() to validate the blogname if subdomain_base_url use {blogname}

Modified: plog/branches/lifetype-1.2/class/data/validator/blognamevalidator.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/validator/blognamevalidator.class.php	2008-07-01 05:26:43 UTC (rev 6686)
+++ plog/branches/lifetype-1.2/class/data/validator/blognamevalidator.class.php	2008-07-01 05:37:16 UTC (rev 6687)
@@ -2,6 +2,7 @@
 
 	lt_include( PLOG_CLASS_PATH."class/data/validator/validator.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/validator/rules/nonemptyrule.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/data/validator/rules/nohtmlrule.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/validator/rules/filteredpatternsrule.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
 
@@ -45,10 +46,14 @@
 			lt_include( PLOG_CLASS_PATH."class/net/http/subdomains.class.php" );
 			lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
 
-			if( Subdomains::getSubdomainsEnabled() )
-				return(( Textfilter::domainize( Textfilter::filterAllHTML( $value ))) != "" );
-			else
-				return(( Textfilter::filterAllHTML( $value )) != "" );
+			if( Subdomains::getSubdomainsEnabled() ) {
+				$config =& Config::getConfig();
+				if( strstr( $config->getValue( "subdomains_base_url" ), '{blogname}' ) ) {
+					return( ( Textfilter::domainize( $value ) ) != "" );
+				}
+			}
+
+			return true;
 		}
     }
 ?>
\ No newline at end of file



More information about the pLog-svn mailing list