I2S DAC not removed from /boot/config.txt


When I choose a DAC from the dropdown menu in the System menu it is correctly set or changed but when I choose None the /boot/config.txt file is not updated and the entry dtoverlay=xxxx stil remains.
No big deal as it does not stop the system from booting and workin, just an error message on the console.

One thing more annoying: it removes any line that was manually added, for example the max_usb_current=1 used on Pi2 to boost the USB ports.

OK, I found the error:
at line 534 of /var/www/settings.php there is one line missing:

file_put_contents($file, $text);