Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable oProxyCommand when imap.enable_insecure_rsh does not exists #11533

Merged
merged 2 commits into from
Nov 28, 2018
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
16 changes: 16 additions & 0 deletions classes/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -1224,4 +1224,20 @@ public static function isThemeName($theme_name)
{
return (bool) preg_match('/^[\w-]{3,255}$/u', $theme_name);
}

/**
* Check if enable_insecure_rsh exists in
* this PHP version otherwise disable the
* oProxyCommand option.
*
* @return bool
*/
public static function isValidImapUrl($imapUrl)
{
if (false === ini_get('imap.enable_insecure_rsh')) {
return preg_match('~^((?!oProxyCommand).)*$~i', $imapUrl);
}

return true;
}
}
1 change: 1 addition & 0 deletions controllers/admin/AdminCustomerThreadsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public function __construct()
'title' => $this->trans('IMAP URL', array(), 'Admin.Catalog.Feature'),
'hint' => $this->trans('URL for your IMAP server (ie.: mail.server.com).', array(), 'Admin.Catalog.Help'),
'type' => 'text',
'validation' => 'isValidImapUrl',
),
'PS_SAV_IMAP_PORT' => array(
'title' => $this->trans('IMAP port', array(), 'Admin.Catalog.Feature'),
Expand Down