Code Duplication    Length = 5-5 lines in 3 locations

mod/blog/actions/blog/auto_save_revision.php 1 location

@@ 26-30 (lines=5) @@
23
24
	if ($guid) {
25
		$entity = get_entity($guid);
26
		if (elgg_instanceof($entity, 'object', 'blog') && $entity->canEdit()) {
27
			$blog = $entity;
28
		} else {
29
			$error = elgg_echo('blog:error:post_not_found');
30
		}
31
	} else {
32
		$blog = new ElggBlog();
33
		$blog->subtype = 'blog';

mod/blog_tools/actions/blog/auto_save_revision.php 1 location

@@ 26-30 (lines=5) @@
23
24
	if ($guid) {
25
		$entity = get_entity($guid);
26
		if (elgg_instanceof($entity, 'object', 'blog') && $entity->canEdit()) {
27
			$blog = $entity;
28
		} else {
29
			$error = elgg_echo('blog:error:post_not_found');
30
		}
31
	} else {
32
		$blog = new ElggBlog();
33
		$blog->subtype = 'blog';

mod/gc_mobile_api/models/blog.php 1 location

@@ 537-541 (lines=5) @@
534
	 $revision_text = '';
535
	 if ($blog_guid){
536
		 $entity = get_entity($blog_guid);
537
		 if (elgg_instanceof($entity, 'object', 'blog') && $entity->canEdit()) {
538
			 	$blog = $entity;
539
		 } else {
540
			 return elgg_echo('blog:error:post_not_found');
541
		 }
542
		 $revision_text = $blog->description;
543
		 $new_post = $blog->new_post; //what?
544
	 } else {