]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Merge r5761:5788 from 1.7 to trunk.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 14 May 2010 16:13:56 +0000 (16:13 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 14 May 2010 16:13:56 +0000 (16:13 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6053 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/xml.php
mod/file/actions/upload.php
mod/groups/actions/forums/deletepost.php

index f691b2475e58a8c3c0530fd3becb24c8ede3e32a..b21fdd92bd05f776cd8968d1b9c35ae2a43bd25c 100644 (file)
                }
                
                if ($n==0) {
-                       $output = "</array>\n";
+                       $output .= "</array>\n";
                }
                
                return $output;
index e515c73e0f4c08a661f49d8722d9a0ce1828c638..5a22b12317b173e91c4f41fcece2d6efac8cae0c 100644 (file)
@@ -87,9 +87,9 @@
 
                        // use same filename on the disk - ensures thumbnails are overwritten
                        $filestorename = $file->getFilename();
-                       $filestorename = substr($filestorename, strlen($prefix));
+                       $filestorename = elgg_substr($filestorename, elgg_strlen($prefix));
                } else {
-                       $filestorename = strtolower(time().$_FILES['upload']['name']);
+                       $filestorename = elgg_strtolower(time().$_FILES['upload']['name']);
                }
                
                $file->setFilename($prefix.$filestorename);
                                unset($thumblarge);
                        }
                }
+       } else {
+               // not saving a file but still need to save the entity to push attributes to database
+               $file->save();
        }
        
        // make sure session cache is cleared
index 4066b7456082e83953b3976a5295990ec7695dfb..14336c1faccfa3f8018f055a42947ef4039994a6 100644 (file)
                        //check that the user can edit as well as admin
                        if ($post->canEdit() || ($post->owner_guid == $_SESSION['user']->guid)) {
                        
-                       //delete
+                       //delete forum comment
                                $post->delete();
+                               
+                               // remove river entry if it exists
+                               remove_from_river_by_annotation($post_id);
+
                                //display confirmation message
                                system_message(elgg_echo("grouppost:deleted"));
-                               
                        }
                        
                } else {