Commit 6819d409 authored by Franco Fichtner's avatar Franco Fichtner

console: fix ppp iteration crash report

parent 89cb020c
...@@ -76,19 +76,20 @@ function console_prompt_for_yn ($prompt_text) { ...@@ -76,19 +76,20 @@ function console_prompt_for_yn ($prompt_text) {
return $boolean_answer; return $boolean_answer;
} }
function console_get_interface_from_ppp($realif) { function console_get_interface_from_ppp($realif)
{
global $config; global $config;
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { if (isset($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) { foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
if ($realif == $ppp['if']) { if ($realif == $ppp['if']) {
$ifaces = explode(",", $ppp['ports']); $ifaces = explode(',', $ppp['ports']);
return $ifaces[0]; return $ifaces[0];
} }
} }
} }
return ""; return '';
} }
function prompt_for_enable_dhcp_server($version = 4) { function prompt_for_enable_dhcp_server($version = 4) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment