1) convert echo to print, and add infobox, as requested in PR comments
2) If no identifiable line number, say so
3) EVAL gives an error message format that wasn't picked up, it is now. Test case - enter as the code: eval("X");
4) Warn that EVAL gives a "spurious" "error at line 1" as well, the real error is in the (...). See above test case for this.
5) Simplify translators' job a bit
6) Try to reduce errors in user code giving NOTICES (see PR comments). Start by defining a dir for user code (only) and putting code in it.
(cherry picked from commit 1155cd6318)
Going to try and stop user code generating notices, by putting it in a specific dir which doesn't give notices for syntax errors.
(cherry picked from commit 8d80a771e3)
If the user enters PHP in the command-line page, and it errors out, it's usually a typo or something minor. But the user is left with an error that references a /tmp file which doesn't exist at the point they read the message, a line number that's incorrect, and their input which doesn't display line numbers anyhow.
This patch fixes this, so that a user who wants to enter php command-line in the GUI and gets an error, can quickly identify the exact line causing the error.
If an error occurs (detected by either non-zero return value or output matching an error message referencing the temp script file), then an short DIV is shown above the usual PHP output for "error location". It gives the correct error line number, and shows the code with line numbers and syntax highlighting (using php's native "-s" option), pre-scrolled to the error line.
(cherry picked from commit fd1bd705c5)
1) Lookup a name with Diag DNS
2) Press "Add Alias"
The alias is added, but the button still says "Add Alias".
Actually the alias exists by now. The button should say "Update Alias".
Fix: once we have emitted the alias create/update success message, we can set $alias_exists true so that the rest of the code is based on the (possibly new) state.(cherry picked from commit 474b275684)
in the interface statistics widget.
At the moment, if all the selected interfaces are down, the widget will just display no columns. That will make users wonder what happened.
(cherry picked from commit b22fceb2d7)
If an interface is down, the widget would write the interface description in a column heading but then omit the stats items. So later columns (to the right) would have the headings and stats items out of line.
This also fixes the performance problem that get_interface_info($ifdescr) was being called for every row of stats data for every interface. i.e. it was called 7 times for each interface when 1 time is enough.
(cherry picked from commit d87a9a1c97)