Skip to content

Commit

Permalink
Fixed the JCB package import url inclusion limitation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Llewellynvdm committed Jun 2, 2022
1 parent f0cdf08 commit 9f04566
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 72 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo

Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!

You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.13.0) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.13.1) with **ALL** its features and **ALL** concepts totally open-source and free!

> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
Expand Down Expand Up @@ -143,11 +143,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 27th May, 2022
+ *Version*: 2.13.0
+ *Last Build*: 2nd June, 2022
+ *Version*: 2.13.1
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **287273**
+ *Line count*: **287278**
+ *Field count*: **1581**
+ *File count*: **1853**
+ *Folder count*: **261**
Expand Down
8 changes: 4 additions & 4 deletions admin/README.txt
Expand Up @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo

Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!

You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.13.0) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.13.1) with **ALL** its features and **ALL** concepts totally open-source and free!

> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)

Expand Down Expand Up @@ -143,11 +143,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 27th May, 2022
+ *Version*: 2.13.0
+ *Last Build*: 2nd June, 2022
+ *Version*: 2.13.1
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **287273**
+ *Line count*: **287278**
+ *Field count*: **1581**
+ *File count*: **1853**
+ *Folder count*: **261**
Expand Down
6 changes: 3 additions & 3 deletions admin/controllers/ajax.json.php
Expand Up @@ -257,10 +257,10 @@ public function ajax()
case 'getJCBpackageInfo':
try
{
$urlValue = $jinput->get('url', NULL, 'STRING');
if($urlValue && $user->id != 0)
$packageValue = $jinput->get('package', NULL, 'BASE64');
if($packageValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getJCBpackageInfo($urlValue);
$result = $this->getModel('ajax')->getJCBpackageInfo($packageValue);
}
else
{
Expand Down
45 changes: 28 additions & 17 deletions admin/helpers/compiler/b_Structure.php
Expand Up @@ -508,6 +508,8 @@ private function buildPowers()
$power->path
))
{
// activate dynamic folders
$this->setDynamicFolders();
// power path
$power->full_path = $this->componentPath . '/'
. $power->path;
Expand Down Expand Up @@ -2257,23 +2259,8 @@ private function setStatic()
&& StringHelper::check($checker[0])
&& !in_array($checker[0], $this->stdFolders))
{
// check if we should add the dynamic folder moving script to the installer script
if (!$this->setMoveFolders)
{
// add the setDynamicF0ld3rs() method to the install scipt.php file
$this->setMoveFolders = true;
// set message that this was done (will still add a tutorial link later)
$this->app->enqueueMessage(
JText::_(
'<hr /><h3>Dynamic folder(s) were detected.</h3>'
), 'Notice'
);
$this->app->enqueueMessage(
JText::sprintf(
'A method (setDynamicF0ld3rs) was added to the install <b>script.php</b> of this package to insure that the folder(s) are copied into the correct place when this component is installed!'
), 'Notice'
);
}
// activate dynamic folders
$this->setDynamicFolders();
}
elseif (count((array) $checker) == 2
&& StringHelper::check($checker[0]))
Expand Down Expand Up @@ -3207,6 +3194,30 @@ private function setJoomlaVersionData()
return $version_data;
}

/**
* Add the dynamic folders
*/
protected function setDynamicFolders()
{
// check if we should add the dynamic folder moving script to the installer script
if (!$this->setMoveFolders)
{
// add the setDynamicF0ld3rs() method to the install scipt.php file
$this->setMoveFolders = true;
// set message that this was done (will still add a tutorial link later)
$this->app->enqueueMessage(
JText::_(
'<hr /><h3>Dynamic folder(s) were detected.</h3>'
), 'Notice'
);
$this->app->enqueueMessage(
JText::sprintf(
'A method (setDynamicF0ld3rs) was added to the install <b>script.php</b> of this package to insure that the folder(s) are copied into the correct place when this component is installed!'
), 'Notice'
);
}
}

/**
* set the index.html file in a folder path
*
Expand Down
5 changes: 3 additions & 2 deletions admin/models/ajax.php
Expand Up @@ -159,9 +159,10 @@ public function getComponentDetails($id)
/**
* get the JCB package info (html)
**/
public function getJCBpackageInfo($url)
public function getJCBpackageInfo($package)
{
// convert URL
$url = base64_decode($package);
$url = str_replace('.zip', '.info', $url);
// check if url exist
if ($info = ComponentbuilderHelper::getFileContents($url, false))
Expand Down Expand Up @@ -199,7 +200,7 @@ public function getJCBpackageInfo($url)
// check if we have json
if ($opened && ComponentbuilderHelper::checkJson($_info))
{
$info = json_decode($info, true);
$info = json_decode($_info, true);
return array('owner' => ComponentbuilderHelper::getPackageOwnerDetailsDisplay($info, true), 'packages' => ComponentbuilderHelper::getPackageComponentsDetailsDisplay($info));
}
}
Expand Down
5 changes: 5 additions & 0 deletions admin/models/import_joomla_components.php
Expand Up @@ -143,6 +143,11 @@ public function import()
break;

case 'url':
$url = JFactory::getApplication()->input->getString('import_url');
if ($url === base64_encode(base64_decode($url, true)))
{
JFactory::getApplication()->input->set('import_url', base64_decode($url));
}
$package = $this->_getPackageFromUrl();
break;

Expand Down

0 comments on commit 9f04566

Please sign in to comment.