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

@@ 483-487 (lines=5) @@
480
	 $revision_text = '';
481
	 if ($blog_guid){
482
		 $entity = get_entity($blog_guid);
483
		 if (elgg_instanceof($entity, 'object', 'blog') && $entity->canEdit()) {
484
			 	$blog = $entity;
485
		 } else {
486
			 return elgg_echo('blog:error:post_not_found');
487
		 }
488
		 $revision_text = $blog->description;
489
		 $new_post = $blog->new_post; //what?
490
	 } else {