Skip to content

Conversation

@Fedik
Copy link
Member

@Fedik Fedik commented Sep 25, 2023

Pull Request for Issue #41907.

Summary of Changes

The installer should stop when package information was not found.

Testing Instructions

Please follow #41907

Actual result BEFORE applying this Pull Request

A PHP error, + Joomla error "Please enter a valid URL"

Expected result AFTER applying this Pull Request

No PHP error, only Joomla error "Please enter a valid URL"

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed

@wilsonge
Copy link
Contributor

This feels weird. We are already trying to set defaults when package is null. How do we end up in a situation where it's false?

@Fedik
Copy link
Member Author

Fedik commented Sep 25, 2023

One of following can easily create a false result

// Did you give us a URL?
if (!$url) {
Factory::getApplication()->enqueueMessage(Text::_('COM_INSTALLER_MSG_INSTALL_ENTER_A_URL'), 'error');
return false;
}
// We only allow http & https here
$uri = new Uri($url);
if (!in_array($uri->getScheme(), ['http', 'https'])) {
Factory::getApplication()->enqueueMessage(Text::_('COM_INSTALLER_MSG_INSTALL_INVALID_URL_SCHEME'), 'error');
return false;
}

Similar applies to _getPackageFromFolder() and _getPackageFromUpload() methods.

@HLeithner HLeithner merged commit 554f77a into joomla:5.0-dev Sep 25, 2023
@HLeithner
Copy link
Member

thanks

@Fedik Fedik deleted the fix-41907 branch September 25, 2023 10:05
@wilsonge wilsonge added this to the Joomla! 5.0 milestone Sep 25, 2023
HLeithner pushed a commit to HLeithner/joomla-cms that referenced this pull request Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants