[pLog-svn] r2276 - plog/branches/plog-1.0.2/class/dao

reto at devel.plogworld.net reto at devel.plogworld.net
Tue Jun 28 21:19:53 GMT 2005


Author: reto
Date: 2005-06-28 21:19:53 +0000 (Tue, 28 Jun 2005)
New Revision: 2276

Modified:
   plog/branches/plog-1.0.2/class/dao/blogs.class.php
Log:
my last commit before my holidays :)
actually a bugfix of my own commit some days ago. this time it should really cover every possible clash with an already existing mangled_name and behave like expected!

have a good time an enjoy the summertime!
reto

Modified: plog/branches/plog-1.0.2/class/dao/blogs.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/dao/blogs.class.php	2005-06-28 13:21:14 UTC (rev 2275)
+++ plog/branches/plog-1.0.2/class/dao/blogs.class.php	2005-06-28 21:19:53 UTC (rev 2276)
@@ -300,7 +300,7 @@
 	            if( $blog->getID() != $blogInfo->getID()) {
 	        		
                     // if we already tried with blogname+"i" we have to strip "i" before adding it again!
-                    $newMangledName = ( ($i > 1) ? substr( $blogInfo->getMangledBlog(), 0, strlen( $blogInfo->getMangledBlog() )-1 ).$i : $blogInfo->getMangledBlog().$i );	    
+                    $newMangledName = ( ($i > 1) ? substr( $blogInfo->getMangledBlog(), 0, strlen( $blogInfo->getMangledBlog() ) - strlen($i-1) ).$i : $blogInfo->getMangledBlog().$i );	    
 	        		$blogInfo->setMangledBlog( $newMangledName );
         		} else
         		{
@@ -396,9 +396,9 @@
             while( $this->getBlogInfoByName( $blog->getMangledBlog() ) )
             {
 	            $i++;
-                
+       
                 // and if so, assign a new one (if we already tried with blogname+"i" we have to strip "i" before adding it again!)
-                $newMangledName = ( ($i > 1) ? substr( $blog->getMangledBlog(), 0, strlen( $blog->getMangledBlog() )-1 ).$i : $blog->getMangledBlog().$i );	    
+                $newMangledName = ( ($i > 1) ? substr( $blog->getMangledBlog(), 0, strlen( $blog->getMangledBlog() )- strlen($i-1) ).$i : $blog->getMangledBlog().$i );	    
 	            $blog->setMangledBlog( $newMangledName );
 
             }




More information about the pLog-svn mailing list