-
Notifications
You must be signed in to change notification settings - Fork 1
/
Record.php
32 lines (27 loc) · 894 Bytes
/
Record.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php declare(strict_types=1);
/**
* Copyright (C) Apis Networks, Inc - All Rights Reserved.
*
* Unauthorized copying of this file, via any medium, is
* strictly prohibited without consent. Any dissemination of
* material herein is prohibited.
*
* For licensing inquiries email <[email protected]>
*
* Written by Matt Saladna <[email protected]>, August 2020
*/
namespace Opcenter\Dns\Providers\Hetzner;
class Record extends \Opcenter\Dns\Record
{
public function __construct(string $zone, array $args)
{
if (substr($args['name'], -strlen($zone)-1) === ".{$zone}") {
$args['name'] = substr($args['name'], 0, -strlen($zone)-1);
}
parent::__construct($zone, $args);
}
protected function formatTxt() {
// remove empty labels
$this->parameter = rtrim(str_replace([' "" ', '" "'], ['', ''], (string)$this->parameter), ' ');
}
}