Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After updating from Github will not upload the image to Media-Manager #3391

Closed
Evgura opened this issue Aug 19, 2018 · 14 comments

Comments

@Evgura
Copy link

commented Aug 19, 2018

After updating from Github will not load the image. All permissions are set.
74555

Or so.

74556

@CaMer0n

This comment has been minimized.

Copy link
Member

commented Aug 19, 2018

@Evgura Could you please send me the image via Gitter. I will need to test with it. Thank you.

@Evgura

This comment has been minimized.

Copy link
Author

commented Aug 19, 2018

@CaMer0n I do not have such a messenger, I do not use it.

@CaMer0n

This comment has been minimized.

Copy link
Member

commented Aug 19, 2018

@Evgura No messenger needed, just go here and login with your Github ID: http://gitter.im/CaMer0n

@CaMer0n CaMer0n changed the title After updating from Github will not load the image After updating from Github will not upload the image to Media-Manager Aug 19, 2018
@CaMer0n

This comment has been minimized.

Copy link
Member

commented Aug 20, 2018

@Jimmi08 @Moc @tgtje @SimSync @rica-carv @Deltik

Are any of you able to reproduce this issue?

@Deltik

This comment has been minimized.

Copy link
Contributor

commented Aug 20, 2018

@CaMer0n: Haven't set up a reproduction, but the condition getting hit is this one in ./e107_web/js/plupload/upload.php on line 195:

        if(e107::getFile()->isClean($filePath) !== true)
        {
                @unlink($filePath);
                die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Bad File Detected."}, "id" : "id"}');
        }

There is a test that calls this same method and the test fails with this result:

2) e_fileTest: Is clean
 Test  tests/unit/e_fileTest.php:testIsClean
isClean() failed with error code: 2
Failed asserting that false matches expected true.
#1  /home/deltikdev/repos/e107-test/tests/unit/e_fileTest.php:56

This is e_fileTest::testIsClean():

		public function testIsClean()
		{

			$isCleanTest = array(
				array('path'=>$this->exploitFile,                       'expected' => false), // suspicious
				array('path'=>e_SYSTEM."filetypes.xml",                 'expected' => true), // okay
				array('path'=>e_PLUGIN."gallery/images/butterfly.jpg",  'expected' => true), // okay
			);

			foreach($isCleanTest as $file)
			{
				$actual = $this->fl->isClean($file['path'], $file['path']);
				$this->assertEquals($file['expected'],$actual, "isClean() failed with error code: ".$this->fl->getErrorCode());
			}

		}

This error seems to be caused by the inability to read the nonexistent file /home/deltikdev/repos/e107-test/e107/e107_system/1cd21b1f20/filetypes.xml. Could it be that e_SYSTEM."/filetypes.xml" doesn't exist on the user's machine?

If that file doesn't exist, it causes another test failure:

2) e_fileTest: Get allowed file types
 Test  tests/unit/e_fileTest.php:testGetAllowedFileTypes
Failed asserting that two arrays are equal.
- Expected | + Actual
@@ @@
Array (
-    'zip' => 2048
-    'gz' => 2048
-    'jpg' => 2048
-    'jpeg' => 2048
-    'png' => 2048
-    'gif' => 2048
-    'xml' => 2048
-    'pdf' => 2048
)
#1  /home/deltikdev/repos/e107-test/tests/unit/e_fileTest.php:76
@CaMer0n

This comment has been minimized.

Copy link
Member

commented Aug 20, 2018

Thank you @Deltik ! Indeed, perhaps this is the cause in @Evgura 's situation.

@CaMer0n CaMer0n added the bug label Aug 20, 2018
@Evgura

This comment has been minimized.

Copy link
Author

commented Aug 20, 2018

File filetypes.xml exists.

@CaMer0n

This comment has been minimized.

Copy link
Member

commented Aug 20, 2018

@Evgura Have you tried other jpg files?

@Evgura

This comment has been minimized.

Copy link
Author

commented Aug 20, 2018

@CaMer0n I make files .jpg (crop, resize) the same program, and before the update to 2.1.9 with Github everything was fine loaded.
Today returned version 2.1.8 and the same photos that you sent, no problem filled in the site.

@CaMer0n

This comment has been minimized.

Copy link
Member

commented Aug 20, 2018

Please send me some of the .jpg files you made.

@Evgura

This comment has been minimized.

Copy link
Author

commented Aug 20, 2018

On Gitter in the archive.

@Deltik

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2018

@CaMer0n: It's more likely that one of the other cases in the e_file::isClean() method is getting tripped. We don't have tests for any of the 9 error cases, and the die()-ing client code does not show which error case occurred.

@tgtje

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2018

Just updated a quit fresh live site (github sync), i can not see/detect , nor have any issues uploading..

However i noticed when looking on the above screenshots... where do they come from ?
I do not see (in different paths of upload; or is mine wrong??) any TABS on media upload like above (youtube/video etc..) Sorry

@CaMer0n CaMer0n added this to the e107 2.2.0 milestone Aug 22, 2018
@Evgura

This comment has been minimized.

Copy link
Author

commented Aug 23, 2018

The problem was solved by updating to version 2.1.9 (e107_v2.x_to_2.1.9_upgrade)

@Evgura Evgura closed this Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.