File manager - Edit - /home/ferretapmx/public_html/com_media.zip
Back
PK o�\�ܷ�� � config.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <config> <help key="Media:_Options"/> <inlinehelp button="show"/> <fieldset name="component" label="COM_MEDIA_FIELDSET_OPTIONS_LABEL"> <help key="Media:_Options"/> <field name="upload_maxsize" type="number" label="COM_MEDIA_FIELD_MAXIMUM_SIZE_LABEL" description="COM_MEDIA_FIELD_MAXIMUM_SIZE_DESC" validate="number" min="0" default="10" /> <field name="file_path" type="text" label="COM_MEDIA_FIELD_PATH_FILE_FOLDER_LABEL" description="COM_MEDIA_FIELD_PATH_FILE_FOLDER_DESC" default="files" validate="folderPathExists" exclude="administrator|api|cache|cli|components|includes|language|layouts|libraries|media|modules|plugins|templates|tmp" /> <field name="image_path" type="text" label="COM_MEDIA_FIELD_PATH_IMAGE_FOLDER_LABEL" description="COM_MEDIA_FIELD_PATH_IMAGE_FOLDER_DESC" default="images" validate="folderPathExists" exclude="administrator|api|cache|cli|components|includes|language|layouts|libraries|modules|plugins|templates|tmp" /> <field name="restrict_uploads" type="radio" label="COM_MEDIA_FIELD_RESTRICT_UPLOADS_LABEL" description="COM_MEDIA_FIELD_RESTRICT_UPLOADS_DESC" layout="joomla.form.field.radio.switcher" default="1" > <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="restrict_uploads_extensions" type="textarea" label="COM_MEDIA_FIELD_RESTRICT_UPLOADS_EXTENSIONS_LABEL" description="COM_MEDIA_FIELD_RESTRICT_UPLOADS_EXTENSIONS_DESC" default="bmp,gif,jpg,jpeg,png,webp,avif,ico,mp3,mp4,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv" showon="restrict_uploads:1" /> <field name="check_mime" type="radio" label="COM_MEDIA_FIELD_CHECK_MIME_LABEL" description="COM_MEDIA_FIELD_CHECK_MIME_DESC" layout="joomla.form.field.radio.switcher" default="1" showon="restrict_uploads:1" > <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="image_extensions" type="textarea" label="COM_MEDIA_FIELD_LEGAL_IMAGE_EXTENSIONS_LABEL" description="COM_MEDIA_FIELD_LEGAL_IMAGE_EXTENSIONS_DESC" default="bmp,gif,jpg,jpeg,png,webp,avif" /> <field name="audio_extensions" type="textarea" label="COM_MEDIA_FIELD_LEGAL_AUDIO_EXTENSIONS_LABEL" description="COM_MEDIA_FIELD_LEGAL_AUDIO_EXTENSIONS_DESC" default="mp3,m4a,mp4a,ogg" /> <field name="video_extensions" type="textarea" label="COM_MEDIA_FIELD_LEGAL_VIDEO_EXTENSIONS_LABEL" description="COM_MEDIA_FIELD_LEGAL_VIDEO_EXTENSIONS_DESC" default="mp4,mp4v,mpeg,mov,webm" /> <field name="doc_extensions" type="textarea" label="COM_MEDIA_FIELD_LEGAL_DOCUMENT_EXTENSIONS_LABEL" description="COM_MEDIA_FIELD_LEGAL_DOCUMENT_EXTENSIONS_DESC" default="doc,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv" /> <field name="ignore_extensions" type="textarea" label="COM_MEDIA_FIELD_IGNORED_EXTENSIONS_LABEL" description="COM_MEDIA_FIELD_IGNORED_EXTENSIONS_DESC" /> <field name="upload_mime" type="textarea" label="COM_MEDIA_FIELD_LEGAL_MIME_TYPES_LABEL" description="COM_MEDIA_FIELD_LEGAL_MIME_TYPES_DESC" default="image/jpeg,image/gif,image/png,image/bmp,image/webp,image/avif,audio/ogg,audio/mpeg,audio/mp4,video/mp4,video/mpeg,video/quicktime,video/webm,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/x-zip" showon="restrict_uploads:1" /> </fieldset> <fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" > <field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" filter="rules" validate="rules" component="com_media" section="component" /> </fieldset> </config> PK o�\@�p t t helpers/media.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_media * * @copyright (C) 2012 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt * * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace */ use Joomla\CMS\Object\CMSObject; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media helper class. * * @since 1.6 */ abstract class MediaHelper { /** * Generates the URL to the object in the action logs component * * @param string $contentType The content type * @param integer $id The integer id * @param CMSObject $mediaObject The media object being uploaded * * @return string The link for the action log * * @since 3.9.27 */ public static function getContentTypeLink($contentType, $id, CMSObject $mediaObject) { if ($contentType === 'com_media.file') { return ''; } $link = 'index.php?option=com_media'; $adapter = $mediaObject->get('adapter'); $uploadedPath = $mediaObject->get('path'); if (!empty($adapter) && !empty($uploadedPath)) { $link .= '&path=' . $adapter . ':' . $uploadedPath; } return $link; } } PK o�\�Sʉ� � helpers/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK o�\�a�?� � src/Dispatcher/Dispatcher.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_media * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Administrator\Dispatcher; use Joomla\CMS\Access\Exception\NotAllowed; use Joomla\CMS\Dispatcher\ComponentDispatcher; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * ComponentDispatcher class for com_media * * @since 4.0.0 */ class Dispatcher extends ComponentDispatcher { /** * Method to check component access permission * * @since 4.0.0 * * @return void */ protected function checkAccess() { $user = $this->app->getIdentity(); $asset = $this->input->get('asset'); $author = $this->input->get('author'); // Access check if ( !$user->authorise('core.manage', 'com_media') && (!$asset || (!$user->authorise('core.edit', $asset) && !$user->authorise('core.create', $asset) && \count($user->getAuthorisedCategories($asset, 'core.create')) == 0) && !($user->id == $author && $user->authorise('core.edit.own', $asset))) ) { throw new NotAllowed($this->app->getLanguage()->_('JERROR_ALERTNOAUTHOR'), 403); } } } PK o�\�Sʉ� � src/Dispatcher/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK o�\z�� � src/Adapter/AdapterInterface.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_media * * @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Administrator\Adapter; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media file adapter interface. * * @since 4.0.0 */ interface AdapterInterface { /** * Returns the requested file or folder. The returned object * has the following properties available: * - type: The type can be file or dir * - name: The name of the file * - path: The relative path to the root * - extension: The file extension * - size: The size of the file * - create_date: The date created * - modified_date: The date modified * - mime_type: The mime type * - width: The width, when available * - height: The height, when available * * If the path doesn't exist a FileNotFoundException is thrown. * * @param string $path The path to the file or folder * * @return \stdClass * * @since 4.0.0 * @throws \Exception */ public function getFile(string $path = '/'): \stdClass; /** * Returns the folders and files for the given path. The returned objects * have the following properties available: * - type: The type can be file or dir * - name: The name of the file * - path: The relative path to the root * - extension: The file extension * - size: The size of the file * - create_date: The date created * - modified_date: The date modified * - mime_type: The mime type * - width: The width, when available * - height: The height, when available * * If the path doesn't exist a FileNotFoundException is thrown. * * @param string $path The folder * * @return \stdClass[] * * @since 4.0.0 * @throws \Exception */ public function getFiles(string $path = '/'): array; /** * Returns a resource for the given path. * * @param string $path The path * * @return resource * * @since 4.0.0 * @throws \Exception */ public function getResource(string $path); /** * Creates a folder with the given name in the given path. * * It returns the new folder name. This allows the implementation * classes to normalise the file name. * * @param string $name The name * @param string $path The folder * * @return string * * @since 4.0.0 * @throws \Exception */ public function createFolder(string $name, string $path): string; /** * Creates a file with the given name in the given path with the data. * * It returns the new file name. This allows the implementation * classes to normalise the file name. * * @param string $name The name * @param string $path The folder * @param string $data The data * * @return string * * @since 4.0.0 * @throws \Exception */ public function createFile(string $name, string $path, $data): string; /** * Updates the file with the given name in the given path with the data. * * @param string $name The name * @param string $path The folder * @param string $data The data * * @return void * * @since 4.0.0 * @throws \Exception */ public function updateFile(string $name, string $path, $data); /** * Deletes the folder or file of the given path. * * @param string $path The path to the file or folder * * @return void * * @since 4.0.0 * @throws \Exception */ public function delete(string $path); /** * Moves a file or folder from source to destination. * * It returns the new destination path. This allows the implementation * classes to normalise the file name. * * @param string $sourcePath The source path * @param string $destinationPath The destination path * @param bool $force Force to overwrite * * @return string * * @since 4.0.0 * @throws \Exception */ public function move(string $sourcePath, string $destinationPath, bool $force = false): string; /** * Copies a file or folder from source to destination. * * It returns the new destination path. This allows the implementation * classes to normalise the file name. * * @param string $sourcePath The source path * @param string $destinationPath The destination path * @param bool $force Force to overwrite * * @return string * * @since 4.0.0 * @throws \Exception */ public function copy(string $sourcePath, string $destinationPath, bool $force = false): string; /** * Returns a public url for the given path. This function can be used by the cloud * adapter to publish the media file and create a permanent publicly accessible * url. * * @param string $path The path to file * * @return string * * @since 4.0.0 * @throws \Joomla\Component\Media\Administrator\Exception\FileNotFoundException */ public function getUrl(string $path): string; /** * Returns the name of the adapter. * It will be shown in the Media Manager * * @return string * * @since 4.0.0 */ public function getAdapterName(): string; /** * Search for a pattern in a given path * * @param string $path The base path for the search * @param string $needle The path to file * @param bool $recursive Do a recursive search * * @return \stdClass[] * * @since 4.0.0 */ public function search(string $path, string $needle, bool $recursive = false): array; } PK o�\�Sʉ� � src/Adapter/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK o�\�K�PTG TG src/Model/ApiModel.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_media * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Administrator\Model; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; use Joomla\Component\Media\Administrator\Event\FetchMediaItemEvent; use Joomla\Component\Media\Administrator\Event\FetchMediaItemsEvent; use Joomla\Component\Media\Administrator\Event\FetchMediaItemUrlEvent; use Joomla\Component\Media\Administrator\Exception\FileExistsException; use Joomla\Component\Media\Administrator\Exception\FileNotFoundException; use Joomla\Component\Media\Administrator\Exception\InvalidPathException; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; use Joomla\Filesystem\File; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Api Model * * @since 4.0.0 */ class ApiModel extends BaseDatabaseModel { use ProviderManagerHelperTrait; /** * The available extensions. * * @var string[] * @since 4.0.0 */ private $allowedExtensions = null; /** * Returns the requested file or folder information. More information * can be found in AdapterInterface::getFile(). * * @param string $adapter The adapter * @param string $path The path to the file or folder * @param array $options The options * * @return \stdClass * * @since 4.0.0 * @throws \Exception * @see AdapterInterface::getFile() */ public function getFile($adapter, $path = '/', $options = []) { // Add adapter prefix to the file returned $file = $this->getAdapter($adapter)->getFile($path); // Check if it is a media file if ($file->type == 'file' && !$this->isMediaFile($file->path)) { throw new InvalidPathException(); } if (isset($options['url']) && $options['url'] && $file->type == 'file') { $file->url = $this->getUrl($adapter, $file->path); } if (isset($options['content']) && $options['content'] && $file->type == 'file') { $resource = $this->getAdapter($adapter)->getResource($file->path); if ($resource) { $file->content = base64_encode(stream_get_contents($resource)); } } $file->path = $adapter . ":" . $file->path; $file->adapter = $adapter; $event = new FetchMediaItemEvent('onFetchMediaItem', ['item' => $file]); Factory::getApplication()->getDispatcher()->dispatch($event->getName(), $event); return $event->getArgument('item'); } /** * Returns the folders and files for the given path. More information * can be found in AdapterInterface::getFiles(). * * @param string $adapter The adapter * @param string $path The folder * @param array $options The options * * @return \stdClass[] * * @since 4.0.0 * @throws \Exception * @see AdapterInterface::getFile() */ public function getFiles($adapter, $path = '/', $options = []) { // Check whether user searching if ($options['search'] != null) { // Do search $files = $this->search($adapter, $options['search'], $path, $options['recursive']); } else { // Grab files for the path $files = $this->getAdapter($adapter)->getFiles($path); } // Add adapter prefix to all the files to be returned foreach ($files as $key => $file) { // Check if the file is valid if ($file->type == 'file' && !$this->isMediaFile($file->path)) { // Remove the file from the data unset($files[$key]); continue; } // Check if we need more information if (isset($options['url']) && $options['url'] && $file->type == 'file') { $file->url = $this->getUrl($adapter, $file->path); } if (isset($options['content']) && $options['content'] && $file->type == 'file') { $resource = $this->getAdapter($adapter)->getResource($file->path); if ($resource) { $file->content = base64_encode(stream_get_contents($resource)); } } $file->path = $adapter . ":" . $file->path; $file->adapter = $adapter; } // Make proper indexes $files = array_values($files); $event = new FetchMediaItemsEvent('onFetchMediaItems', ['items' => $files]); Factory::getApplication()->getDispatcher()->dispatch($event->getName(), $event); return $event->getArgument('items'); } /** * Creates a folder with the given name in the given path. More information * can be found in AdapterInterface::createFolder(). * * @param string $adapter The adapter * @param string $name The name * @param string $path The folder * @param boolean $override Should the folder being overridden when it exists * * @return string * * @since 4.0.0 * @throws \Exception * @see AdapterInterface::createFolder() */ public function createFolder($adapter, $name, $path, $override) { try { $file = $this->getFile($adapter, $path . '/' . $name); } catch (FileNotFoundException) { // Do nothing } // Check if the file exists if (isset($file) && !$override) { throw new FileExistsException(); } $app = Factory::getApplication(); $object = new CMSObject(); $object->adapter = $adapter; $object->name = $name; $object->path = $path; PluginHelper::importPlugin('content'); $result = $app->triggerEvent('onContentBeforeSave', ['com_media.folder', $object, true, $object]); if (\in_array(false, $result, true)) { throw new \Exception($object->getError()); } $object->name = $this->getAdapter($object->adapter)->createFolder($object->name, $object->path); $app->triggerEvent('onContentAfterSave', ['com_media.folder', $object, true, $object]); return $object->name; } /** * Creates a file with the given name in the given path with the data. More information * can be found in AdapterInterface::createFile(). * * @param string $adapter The adapter * @param string $name The name * @param string $path The folder * @param string $data The data * @param boolean $override Should the file being overridden when it exists * * @return string * * @since 4.0.0 * @throws \Exception * @see AdapterInterface::createFile() */ public function createFile($adapter, $name, $path, $data, $override) { try { $file = $this->getFile($adapter, $path . '/' . $name); } catch (FileNotFoundException) { // Do nothing } // Check if the file exists if (isset($file) && !$override) { throw new FileExistsException(); } // Check if it is a media file if (!$this->isMediaFile($path . '/' . $name)) { throw new InvalidPathException(Text::_('JLIB_MEDIA_ERROR_WARNFILETYPE')); } $app = Factory::getApplication(); $object = new CMSObject(); $object->adapter = $adapter; $object->name = $name; $object->path = $path; $object->data = $data; $object->extension = strtolower(File::getExt($name)); PluginHelper::importPlugin('content'); // Also include the filesystem plugins, perhaps they support batch processing too PluginHelper::importPlugin('media-action'); $result = $app->triggerEvent('onContentBeforeSave', ['com_media.file', $object, true, $object]); if (\in_array(false, $result, true)) { throw new \Exception($object->getError()); } $object->name = $this->getAdapter($object->adapter)->createFile($object->name, $object->path, $object->data); $app->triggerEvent('onContentAfterSave', ['com_media.file', $object, true, $object]); return $object->name; } /** * Updates the file with the given name in the given path with the data. More information * can be found in AdapterInterface::updateFile(). * * @param string $adapter The adapter * @param string $name The name * @param string $path The folder * @param string $data The data * * @return void * * @since 4.0.0 * @throws \Exception * @see AdapterInterface::updateFile() */ public function updateFile($adapter, $name, $path, $data) { // Check if it is a media file if (!$this->isMediaFile($path . '/' . $name)) { throw new InvalidPathException(); } $app = Factory::getApplication(); $object = new CMSObject(); $object->adapter = $adapter; $object->name = $name; $object->path = $path; $object->data = $data; $object->extension = strtolower(File::getExt($name)); PluginHelper::importPlugin('content'); // Also include the filesystem plugins, perhaps they support batch processing too PluginHelper::importPlugin('media-action'); $result = $app->triggerEvent('onContentBeforeSave', ['com_media.file', $object, false, $object]); if (\in_array(false, $result, true)) { throw new \Exception($object->getError()); } $this->getAdapter($object->adapter)->updateFile($object->name, $object->path, $object->data); $app->triggerEvent('onContentAfterSave', ['com_media.file', $object, false, $object]); } /** * Deletes the folder or file of the given path. More information * can be found in AdapterInterface::delete(). * * @param string $adapter The adapter * @param string $path The path to the file or folder * * @return void * * @since 4.0.0 * @throws \Exception * @see AdapterInterface::delete() */ public function delete($adapter, $path) { $file = $this->getFile($adapter, $path); // Check if it is a media file if ($file->type == 'file' && !$this->isMediaFile($file->path)) { throw new InvalidPathException(); } $type = $file->type === 'file' ? 'file' : 'folder'; $app = Factory::getApplication(); $object = new CMSObject(); $object->adapter = $adapter; $object->path = $path; PluginHelper::importPlugin('content'); // Also include the filesystem plugins, perhaps they support batch processing too PluginHelper::importPlugin('media-action'); $result = $app->triggerEvent('onContentBeforeDelete', ['com_media.' . $type, $object]); if (\in_array(false, $result, true)) { throw new \Exception($object->getError()); } $this->getAdapter($object->adapter)->delete($object->path); $app->triggerEvent('onContentAfterDelete', ['com_media.' . $type, $object]); } /** * Copies file or folder from source path to destination path * If forced, existing files/folders would be overwritten * * @param string $adapter The adapter * @param string $sourcePath Source path of the file or folder (relative) * @param string $destinationPath Destination path(relative) * @param bool $force Force to overwrite * * @return string * * @since 4.0.0 * @throws \Exception */ public function copy($adapter, $sourcePath, $destinationPath, $force = false) { return $this->getAdapter($adapter)->copy($sourcePath, $destinationPath, $force); } /** * Moves file or folder from source path to destination path * If forced, existing files/folders would be overwritten * * @param string $adapter The adapter * @param string $sourcePath Source path of the file or folder (relative) * @param string $destinationPath Destination path(relative) * @param bool $force Force to overwrite * * @return string * * @since 4.0.0 * @throws \Exception */ public function move($adapter, $sourcePath, $destinationPath, $force = false) { return $this->getAdapter($adapter)->move($sourcePath, $destinationPath, $force); } /** * Returns a url for serve media files from adapter. * Url must provide a valid image type to be displayed on Joomla! site. * * @param string $adapter The adapter * @param string $path The relative path for the file * * @return string Permalink to the relative file * * @since 4.0.0 * @throws FileNotFoundException */ public function getUrl($adapter, $path) { // Check if it is a media file if (!$this->isMediaFile($path)) { throw new InvalidPathException(); } $url = $this->getAdapter($adapter)->getUrl($path); $event = new FetchMediaItemUrlEvent('onFetchMediaFileUrl', ['adapter' => $adapter, 'path' => $path, 'url' => $url]); Factory::getApplication()->getDispatcher()->dispatch($event->getName(), $event); return $event->getArgument('url'); } /** * Search for a pattern in a given path * * @param string $adapter The adapter to work on * @param string $needle The search therm * @param string $path The base path for the search * @param bool $recursive Do a recursive search * * @return \stdClass[] * * @since 4.0.0 * @throws \Exception */ public function search($adapter, $needle, $path = '/', $recursive = true) { return $this->getAdapter($adapter)->search($path, $needle, $recursive); } /** * Checks if the given path is an allowed media file. * * @param string $path The path to file * * @return boolean * * @since 4.0.0 */ private function isMediaFile($path) { // Check if there is an extension available if (!strrpos($path, '.')) { return false; } // Initialize the allowed extensions if ($this->allowedExtensions === null) { // Get options from the input or fallback to images only $mediaTypes = explode(',', Factory::getApplication()->getInput()->getString('mediatypes', '0')); $types = []; $extensions = []; // Default to showing all supported formats if (\count($mediaTypes) === 0) { $mediaTypes = ['0', '1', '2', '3']; } array_map( function ($mediaType) use (&$types) { switch ($mediaType) { case '0': $types[] = 'images'; break; case '1': $types[] = 'audios'; break; case '2': $types[] = 'videos'; break; case '3': $types[] = 'documents'; break; default: break; } }, $mediaTypes ); $images = array_map( 'trim', explode( ',', ComponentHelper::getParams('com_media')->get( 'image_extensions', 'bmp,gif,jpg,jpeg,png,webp,avif' ) ) ); $audios = array_map( 'trim', explode( ',', ComponentHelper::getParams('com_media')->get( 'audio_extensions', 'mp3,m4a,mp4a,ogg' ) ) ); $videos = array_map( 'trim', explode( ',', ComponentHelper::getParams('com_media')->get( 'video_extensions', 'mp4,mp4v,mpeg,mov,webm' ) ) ); $documents = array_map( 'trim', explode( ',', ComponentHelper::getParams('com_media')->get( 'doc_extensions', 'doc,odg,odp,ods,odt,pdf,ppt,txt,xcf,xls,csv' ) ) ); foreach ($types as $type) { if (\in_array($type, ['images', 'audios', 'videos', 'documents'])) { $extensions = array_merge($extensions, ${$type}); } } // Make them an array $this->allowedExtensions = $extensions; } // Extract the extension $extension = strtolower(substr($path, strrpos($path, '.') + 1)); // Check if the extension exists in the allowed extensions return \in_array($extension, $this->allowedExtensions); } } PK o�\�䁄 src/Model/FileModel.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_media * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Administrator\Model; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\MVC\Model\FormModel; use Joomla\CMS\Plugin\PluginHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * File Model * * @since 4.0.0 */ class FileModel extends FormModel { /** * Method to get the record form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. * * @return \Joomla\CMS\Form\Form|boolean A Form object on success, false on failure * * @since 4.0.0 */ public function getForm($data = [], $loadData = true) { PluginHelper::importPlugin('media-action'); // Load backend forms in frontend. FormHelper::addFormPath(JPATH_ADMINISTRATOR . '/components/com_media/forms'); // Get the form. $form = $this->loadForm('com_media.file', 'file', ['control' => 'jform', 'load_data' => $loadData]); if (empty($form)) { return false; } return $form; } /** * Method to get the file information for the given path. Path must be * in the format: adapter:path/to/file.extension * * @param string $path The path to get the information from. * * @return \stdClass An object with file information * * @since 4.0.0 * @see ApiModel::getFile() */ public function getFileInformation($path) { [$adapter, $path] = explode(':', $path, 2); return $this->bootComponent('com_media')->getMVCFactory()->createModel('Api', 'Administrator') ->getFile($adapter, $path, ['url' => true, 'content' => true]); } } PK o�\�Sʉ� � src/Model/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK o�\���'B B src/Model/MediaModel.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_media * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Media\Administrator\Model; use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Component\Media\Administrator\Provider\ProviderManagerHelperTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Media View Model * * @since 4.0.0 */ class MediaModel extends BaseDatabaseModel { use ProviderManagerHelperTrait; /** * Obtain list of supported providers * * @return array * * @since 4.0.0 */ public function getProviders() { $results = []; foreach ($this->getProviderManager()->getProviders() as $provider) { $result = new \stdClass(); $result->name = $provider->getID(); $result->displayName = $provider->getDisplayName(); $result->adapterNames = []; foreach ($provider->getAdapters() as $adapter) { $result->adapterNames[] = $adapter->getAdapterName(); } $results[] = $result; } return $results; } } PK o�\�'zJ� � "