[GH-ISSUE #65] Missing a closing bracket in misc.php #36

Closed
opened 2026-02-28 01:20:40 +03:00 by kerem · 4 comments
Owner

Originally created by @lamehost on GitHub (Dec 22, 2015).
Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/65

There's a trivial typo in includes/misc.inc.php .
Line 7 misses a closing bracket:

--- misc.inc.php.ORIG   2015-12-22 15:42:22.662075389 +0100
+++ misc.inc.php    2015-12-21 12:24:43.412742515 +0100
@@ -4,7 +4,7 @@

 $blocklogin = FALSE;

-if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport)) or (!isset($apivers) or empty($apivers)) {
+if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport)) or (!isset($apivers) or empty($apivers))) {
     $errormsg = 'You need to configure your settings for the PowerDNS API. See <a href="doc/apiconf.txt">doc/apiconf.txt</a>';
     $blocklogin = TRUE;
 }

Thank you

Originally created by @lamehost on GitHub (Dec 22, 2015). Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/65 There's a trivial typo in includes/misc.inc.php . Line 7 misses a closing bracket: ``` --- misc.inc.php.ORIG 2015-12-22 15:42:22.662075389 +0100 +++ misc.inc.php 2015-12-21 12:24:43.412742515 +0100 @@ -4,7 +4,7 @@ $blocklogin = FALSE; -if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport)) or (!isset($apivers) or empty($apivers)) { +if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport)) or (!isset($apivers) or empty($apivers))) { $errormsg = 'You need to configure your settings for the PowerDNS API. See <a href="doc/apiconf.txt">doc/apiconf.txt</a>'; $blocklogin = TRUE; } ``` Thank you
kerem closed this issue 2026-02-28 01:20:40 +03:00
Author
Owner

@job commented on GitHub (Dec 22, 2015):

This patch gets rid of the PHP error, but I suspect there still is a bug in the logic.

<!-- gh-comment-id:166633709 --> @job commented on GitHub (Dec 22, 2015): This patch gets rid of the PHP error, but I suspect there still is a bug in the logic.
Author
Owner

@tuxis-ie commented on GitHub (Dec 22, 2015):

I do see the error, I don't see where the logical error would be?

Mark Schouten

On 22 Dec 2015, at 14:47, Job Snijders notifications@github.com wrote:

This patch gets rid of the PHP error, but I suspect there still is a bug in the logic.


Reply to this email directly or view it on GitHub.

<!-- gh-comment-id:166723425 --> @tuxis-ie commented on GitHub (Dec 22, 2015): I do see the error, I don't see where the logical error would be? Mark Schouten > On 22 Dec 2015, at 14:47, Job Snijders notifications@github.com wrote: > > This patch gets rid of the PHP error, but I suspect there still is a bug in the logic. > > — > Reply to this email directly or view it on GitHub.
Author
Owner

@job commented on GitHub (Dec 22, 2015):

@tuxis-ie after adding the ) the nsedit page kept asking me to configure access to the API, although I configured it. We can debug when you are back from vacation

<!-- gh-comment-id:166725032 --> @job commented on GitHub (Dec 22, 2015): @tuxis-ie after adding the `)` the nsedit page kept asking me to configure access to the API, although I configured it. We can debug when you are back from vacation
Author
Owner

@ruben-herold commented on GitHub (Dec 30, 2015):

Hi I found the error:

empty also matches to "0" or 0:

empty — Determine whether a variable is empty

In other words, it will return true if the variable is an empty string, false, array(), NULL, “0?, 0, and an unset variable.

So I would fix ist this way:

-if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport)) or (!isset($apivers) or empty($apivers)) {
+if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport)) or (!isset($apivers) or is_null($apivers))) {

<!-- gh-comment-id:168084727 --> @ruben-herold commented on GitHub (Dec 30, 2015): Hi I found the error: empty also matches to "0" or 0: ``` empty — Determine whether a variable is empty ``` In other words, it will return true if the variable is an empty string, false, array(), NULL, “0?, 0, and an unset variable. So I would fix ist this way: -if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport)) or (!isset($apivers) or empty($apivers)) { +if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport)) or (!isset($apivers) or is_null($apivers))) {
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nsedit#36
No description provided.