Skip to content

Commit

Permalink
jinputfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Lodder committed Mar 12, 2019
1 parent 3791d7e commit 00fbbfe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Input\Files;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Installer\InstallerHelper;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -254,7 +255,7 @@ protected function _getPackageFromUpload()
// Get the uploaded file information.
$input = Factory::getApplication()->input;

// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See \JInputFiles::get.
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See Files::get.
$userfile = $input->files->get('install_package', null, 'raw');

// Make sure that file uploads are enabled in php.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Http\HttpFactory;
use Joomla\CMS\Input\Files;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
Expand Down Expand Up @@ -893,7 +894,7 @@ public function upload()
// Get the uploaded file information.
$input = Factory::getApplication()->input;

// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See \JInputFiles::get.
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See Files::get.
$userfile = $input->files->get('install_package', null, 'raw');

// Make sure that file uploads are enabled in php.
Expand Down
7 changes: 4 additions & 3 deletions build/build-modules-js/namespace.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const RootPath = require('./utils/rootpath.es6.js')._();


const jregex = /defined\('(JPATH_BASE|_JEXEC|JPATH_PLATFORM)'\) or die;/gm;
const oldClassName = 'JInputCli';
const classUse = 'use Joomla\\CMS\\Input\\Cli;';
const oldClassName = 'JInputFiles';
const classUse = 'use Joomla\\CMS\\Input\\Files;';
const newClassName = classUse.substr(classUse.lastIndexOf('\\') + 1).slice(0, -1);
const root = `${RootPath}/`;
const filesToIgnore = [
Expand Down Expand Up @@ -60,7 +60,8 @@ const readFile = (path) => {
};

const getInstances = (content, path) => {
const regex = /(?=\S)(?!\/\*\*)(?!\/\/)(?!\*)(\\?JInputCli)/gm;
// To-Do: Use the `oldClassName` to populate this
const regex = /(?=\S)(?!\/\*\*)(?!\/\/)(?!\*)(\\?JInputFiles)/gm;
const matches = content.match(regex);

if (matches !== null) {
Expand Down

0 comments on commit 00fbbfe

Please sign in to comment.