[GH-ISSUE #142] Error in processing template records if name is '' #88

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

Originally created by @bajizs on GitHub (Mar 29, 2017).
Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/142

If you have empty name for some template records (for example MX record), get an API error of not canonical name.

can be solved withthis lines in zones .php (replace lines 296-298 with next lines):
foreach ($template['records'] as $record) {
$name = $record['name'];
if ('' == $name) {
$name = $zone->name;
} elseif (string_ends_with($name, '.')) {
$name = substr($name, 0, -1);
if (!string_ends_with($name, $zone->name)) {
jtable_respond(null, 'error', "Name $name not in zone ".$zone->name);
}
} else if (!string_ends_with($name, $zone->name)) {
$name = $name . '.' . $zone->name;
}
$zone->addRecord($name, $record['type'], $record['content']);
}

Originally created by @bajizs on GitHub (Mar 29, 2017). Original GitHub issue: https://github.com/tuxis-ie/nsedit/issues/142 If you have empty name for some template records (for example MX record), get an API error of not canonical name. can be solved withthis lines in zones .php (replace lines 296-298 with next lines): foreach ($template['records'] as $record) { $name = $record['name']; if ('' == $name) { $name = $zone->name; } elseif (string_ends_with($name, '.')) { $name = substr($name, 0, -1); if (!string_ends_with($name, $zone->name)) { jtable_respond(null, 'error', "Name $name not in zone ".$zone->name); } } else if (!string_ends_with($name, $zone->name)) { $name = $name . '.' . $zone->name; } $zone->addRecord($name, $record['type'], $record['content']); }
kerem closed this issue 2026-02-28 01:20:56 +03:00
Author
Owner

@tuxis-ie commented on GitHub (Mar 29, 2017):

This works for me?

        array(
            'name'      => '',
            'type'      => 'MX',
            'content'   => '10 connect.tuxis.nl.'),
        array(
            'name'      => '',
            'type'      => 'MX',
            'content'   => '20 fallback.tuxis.nl.'),
<!-- gh-comment-id:290097684 --> @tuxis-ie commented on GitHub (Mar 29, 2017): This works for me? ``` array( 'name' => '', 'type' => 'MX', 'content' => '10 connect.tuxis.nl.'), array( 'name' => '', 'type' => 'MX', 'content' => '20 fallback.tuxis.nl.'), ```
Author
Owner

@bajizs commented on GitHub (Mar 29, 2017):

On relase v1.1?

<!-- gh-comment-id:290115741 --> @bajizs commented on GitHub (Mar 29, 2017): On relase v1.1?
Author
Owner

@tuxis-ie commented on GitHub (Apr 28, 2017):

Yes, always worked.

<!-- gh-comment-id:297972669 --> @tuxis-ie commented on GitHub (Apr 28, 2017): Yes, always worked.
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#88
No description provided.