Project

General

Profile

« Previous | Next » 

Revision d23f3e6c

Added by Marcos M 8 months ago

Always use the highest existing zone ID when creating a new one. Fix #15772

View differences:

src/usr/local/www/services_captiveportal.php
321 321
	if (!$input_errors) {
322 322
		$newcp = $a_zone;
323 323
		if (empty($newcp['zoneid'])) {
324
			$newcp['zoneid'] = 2;
325
			foreach ($a_cp as $keycpzone => $cp) {
326
				if ($cp['zoneid'] == $newcp['zoneid'] && $keycpzone != $cpzone) {
327
					$newcp['zoneid'] += 2; /* Reserve space for SSL/TLS config if needed */
328
				}
329
			}
330

  
324
			$current_zoneids = array_flip(array_column($a_cp, 'zoneid'));
325
			ksort($current_zoneids, SORT_NATURAL);
326
			/* Reserve space for SSL/TLS config if needed by */
327
			$newcp['zoneid'] = intval(array_key_last($current_zoneids)) + 2;
331 328
			$cpzoneid = $newcp['zoneid'];
332 329
		}
333 330
		if (is_array($_POST['cinterface'])) {

Also available in: Unified diff