{"code": " public function testSmtpConnect()\n {\n $this->Mail->SMTPDebug = 4; //Show connection-level errors\n $this->assertTrue($this->Mail->smtpConnect(), 'SMTP single connect failed');\n $this->Mail->smtpClose();\n $this->Mail->Host = \"ssl://localhost:12345;tls://localhost:587;10.10.10.10:54321;localhost:12345;10.10.10.10\";\n $this->assertFalse($this->Mail->smtpConnect(), 'SMTP bad multi-connect succeeded');\n $this->Mail->smtpClose();\n $this->Mail->Host = \"localhost:12345;10.10.10.10:54321;\" . $_REQUEST['mail_host'];\n $this->assertTrue($this->Mail->smtpConnect(), 'SMTP multi-connect failed');\n $this->Mail->smtpClose();\n $this->Mail->Host = \" localhost:12345 ; \" . $_REQUEST['mail_host'] . ' ';\n $this->assertTrue($this->Mail->smtpConnect(), 'SMTP hosts with stray spaces failed');\n $this->Mail->smtpClose();\n $this->Mail->Host = $_REQUEST['mail_host'];\n //Need to pick a harmless option so as not cause problems of its own! socket:bind doesn't work with Travis-CI\n $this->assertTrue(\n $this->Mail->smtpConnect(array('ssl' => array('verify_depth' => 10))),\n 'SMTP connect with options failed'\n );\n }", "label": 1, "programming_language": "PHP", "cwe_id": "CWE-20", "cwe_name": "Improper Input Validation", "description": "The product receives input or data, but it does\n not validate or incorrectly validates that the input has the\n properties that are required to process the data safely and\n correctly.", "url": "https://cwe.mitre.org/data/definitions/20.html", "label_name": "safe"} {"code": "function PMA_getErrorReportForm()\n{\n $html = \"\";\n $html .= '
';\n\n return $html;\n}", "label": 1, "programming_language": "PHP", "cwe_id": "CWE-79", "cwe_name": "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')", "description": "The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.", "url": "https://cwe.mitre.org/data/definitions/79.html", "label_name": "safe"} {"code": "function PMA_Process_formset(FormDisplay $form_display)\n{\n if (isset($_GET['mode']) && $_GET['mode'] == 'revert') {\n // revert erroneous fields to their default values\n $form_display->fixErrors();\n PMA_generateHeader303();\n }\n\n if (!$form_display->process(false)) {\n // handle form view and failed POST\n $form_display->display(true, true);\n return;\n }\n\n // check for form errors\n if (!$form_display->hasErrors()) {\n PMA_generateHeader303();\n return;\n }\n\n // form has errors, show warning\n $separator = PMA_URL_getArgSeparator('html');\n $page = isset($_GET['page']) ? $_GET['page'] : null;\n $formset = isset($_GET['formset']) ? $_GET['formset'] : null;\n $formset = $formset ? \"{$separator}formset=$formset\" : '';\n $formId = PMA_isValid($_GET['id'], 'numeric') ? $_GET['id'] : null;\n if ($formId === null && $page == 'servers') {\n // we've just added a new server, get its id\n $formId = $form_display->getConfigFile()->getServerCount();\n }\n $formId = $formId ? \"{$separator}id=$formId\" : '';\n ?>\n' + translate('You have administration messages') + '
';\n for(var i = 0 ; i < messages.length; i++) {\n /* eslint-disable-next-line security/detect-object-injection */ // verified false positive\n var m = messages[i];\n const ago = Math.round((Date.now() - m.lastRecorded) / 60000);\n html += wrapmessage(translate(m.title), translate(m.message), m.count, ago, m.persistent);\n }\n } else {\n if (messageCount > 0) {\n html = wrapmessage(translate('Admin messages in queue'), translate('Please sign in using the API_SECRET to see your administration messages'));\n } else {\n html = wrapmessage(translate('Queue empty'), translate('There are no admin messages in queue'));\n }\n }\n html += '