Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

fix drone tests fixes #142 #143

Merged
merged 2 commits into from
Apr 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions administrator/components/com_media/controllers/api.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private function checkContent($name, $mediaContent)

$params = JComponentHelper::getParams('com_media');

$helper = new JHelperMedia();
$helper = new JHelperMedia;
$serverlength = $this->input->server->get('CONTENT_LENGTH');

if ($serverlength > ($params->get('upload_maxsize', 0) * 1024 * 1024)
Expand All @@ -234,7 +234,7 @@ private function checkContent($name, $mediaContent)
throw new Exception(JText::_('JLIB_MEDIA_ERROR_UPLOAD_INPUT'));
}

if (!$helper->canUpload(array('name' => $name, 'size' => sizeof($mediaContent), 'tmp_name' => $tmpFile), 'com_media'))
if (!$helper->canUpload(array('name' => $name, 'size' => count($mediaContent), 'tmp_name' => $tmpFile), 'com_media'))
{
JFile::delete($tmpFile);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
class MediaFileAdapterFilenotfoundexception extends Exception
{

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getFile($path = '/')
// Check if file exists
if (!file_exists($basePath))
{
throw new MediaFileAdapterFilenotfoundexception();
throw new MediaFileAdapterFilenotfoundexception;
}

return $this->getPathInformation($basePath);
Expand Down Expand Up @@ -112,7 +112,7 @@ public function getFiles($path = '/', $filter = '')
// Check if file exists
if (!file_exists($basePath))
{
throw new MediaFileAdapterFilenotfoundexception();
throw new MediaFileAdapterFilenotfoundexception;
}

// Check if the path points to a file
Expand Down Expand Up @@ -189,7 +189,7 @@ public function updateFile($name, $path, $data)
{
if (!JFile::exists($this->rootPath . $path . '/' . $name))
{
throw new MediaFileAdapterFilenotfoundexception();
throw new MediaFileAdapterFilenotfoundexception;
}

JFile::write($this->rootPath . $path . '/' . $name, $data);
Expand All @@ -212,7 +212,7 @@ public function delete($path)
{
if (!JFile::exists($this->rootPath . $path))
{
throw new MediaFileAdapterFilenotfoundexception();
throw new MediaFileAdapterFilenotfoundexception;
}

$success = JFile::delete($this->rootPath . $path);
Expand All @@ -221,7 +221,7 @@ public function delete($path)
{
if (!JFolder::exists($this->rootPath . $path))
{
throw new MediaFileAdapterFilenotfoundexception();
throw new MediaFileAdapterFilenotfoundexception;
}

$success = JFolder::delete($this->rootPath . $path);
Expand Down Expand Up @@ -272,9 +272,13 @@ private function getPathInformation($path)
$obj->extension = !$isDir ? JFile::getExt($obj->name) : '';
$obj->size = !$isDir ? filesize($path) : 0;
$obj->create_date = $createDate->format('c', true);
$obj->create_date_formatted = (string) $createDate; // TODO use format from config

// TODO use format from config
$obj->create_date_formatted = (string) $createDate;
$obj->modified_date = $modifiedDate->format('c', true);
$obj->modified_date_formatted = (string) $modifiedDate; // TODO use format from config

// TODO use format from config
$obj->modified_date_formatted = (string) $modifiedDate;
$obj->mime_type = mime_content_type($path);
$obj->width = 0;
$obj->height = 0;
Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/application/administrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function getTemplate($params = false)

if (!file_exists(JPATH_THEMES . '/' . $template->template . '/index.php'))
{
// $this->enqueueMessage(JText::_('JERROR_ALERTNOTEMPLATE'), 'error');
$this->enqueueMessage(JText::_('JERROR_ALERTNOTEMPLATE'), 'error');
$template->params = new Registry;
$template->template = 'atum';
}
Expand Down