Skip to content

Commit 2af680e

Browse files
author
thom
committed
Only change names with just @ or *
1 parent c08601c commit 2af680e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

interface/web/dns/dns_edit_base.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ function onSubmit() {
114114
} // end if user is not admin
115115

116116
// Replace @ to example.com.
117-
if(stristr($this->dataRecord["name"], '@')) {
118-
$this->dataRecord["name"] = str_replace('@', $soa['origin'], $this->dataRecord["name"]);
117+
if($this->dataRecord["name"] === '@') {
118+
$this->dataRecord["name"] = $soa['origin'];
119119
}
120120

121121
// Replace * to *.example.com.
122-
if(stristr($this->dataRecord["name"], '*')) {
123-
$this->dataRecord["name"] = str_replace('*', '*.' . $soa['origin'], $this->dataRecord["name"]);
122+
if($this->dataRecord["name"] === '*') {
123+
$this->dataRecord["name"] = '*.' . $soa['origin'];
124124
}
125125

126126
if($this->checkDuplicate()) $app->tform->errorMessage .= $app->tform->lng("data_error_duplicate")."<br>";

0 commit comments

Comments
 (0)