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

oscar at devel.plogworld.net oscar at devel.plogworld.net
Wed Jun 15 21:11:01 GMT 2005


Author: oscar
Date: 2005-06-15 21:11:00 +0000 (Wed, 15 Jun 2005)
New Revision: 2241

Modified:
   plog/branches/plog-1.0.2/class/dao/blogs.class.php
Log:
fixed a little bug


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-15 21:03:10 UTC (rev 2240)
+++ plog/branches/plog-1.0.2/class/dao/blogs.class.php	2005-06-15 21:11:00 UTC (rev 2241)
@@ -288,10 +288,13 @@
         function updateBlog( $blogId, &$blogInfo )
         {
 	        // check if there already is a blog wiht the same mangled name
-            if( $this->getBlogInfoByName( $blogInfo->getMangledBlog())) {
-	            // and if so, assign a new one...
-	        	$newMangledName = $blogInfo->getMangledBlog().$blogInfo->getId();	    
-	        	$blogInfo->setMangledBlog( $newMangledName );
+            if( ($blog = $this->getBlogInfoByName( $blogInfo->getMangledBlog()))) {
+	            // and if so, assign a new one but making sure that we are not actually
+	            // seeing ourselves!
+	            if( $blog->getId() != $blogInfo->getId()) {
+	        		$newMangledName = $blogInfo->getMangledBlog().$blogInfo->getId();	    
+	        		$blogInfo->setMangledBlog( $newMangledName );
+        		}
             }	        
 	        
             $query = "UPDATE ".$this->getPrefix()."blogs SET




More information about the pLog-svn mailing list