mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-12-26 00:15:16 +00:00
NOISSUE prevent -version being passed to the JRE
We want specific JREs, always, not something that is magically resolved. This counteracts some really bad advice recently being spread on reddit.
This commit is contained in:
parent
e4d8ae582d
commit
6afff3e31f
@ -17,6 +17,17 @@ bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent)
|
|||||||
QMessageBox::Warning)->exec();
|
QMessageBox::Warning)->exec();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// block lunacy with passing required version to the JVM
|
||||||
|
if (jvmargs.contains(QRegExp("-version:.*"))) {
|
||||||
|
auto warnStr = QObject::tr(
|
||||||
|
"You tried to pass required java version argument to the JVM (using \"-version=xxx\"). This is not safe and will not be allowed.\n"
|
||||||
|
"This message will be displayed until you remove this from the JVM arguments.");
|
||||||
|
CustomMessageBox::selectable(
|
||||||
|
parent, QObject::tr("JVM arguments warning"),
|
||||||
|
warnStr,
|
||||||
|
QMessageBox::Warning)->exec();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,10 @@ void LaunchController::executeTask()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
JavaCommon::checkJVMArgs(m_instance->settings()->get("JvmArgs").toString(), m_parentWidget);
|
if(!JavaCommon::checkJVMArgs(m_instance->settings()->get("JvmArgs").toString(), m_parentWidget)) {
|
||||||
|
emitFailed(tr("Invalid Java arguments specified. Please fix this first."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
login();
|
login();
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,6 @@ void InstanceSettingsPage::applySettings()
|
|||||||
if(javaArgs)
|
if(javaArgs)
|
||||||
{
|
{
|
||||||
m_settings->set("JvmArgs", ui->jvmArgsTextBox->toPlainText().replace("\n", " "));
|
m_settings->set("JvmArgs", ui->jvmArgsTextBox->toPlainText().replace("\n", " "));
|
||||||
JavaCommon::checkJVMArgs(m_settings->get("JvmArgs").toString(), this->parentWidget());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user