mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-03 17:43:22 +02:00
Fixed issue with city naming
This commit is contained in:
parent
621976f11a
commit
483554762a
3 changed files with 4 additions and 4 deletions
|
@ -135,7 +135,7 @@ class ContactsController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\s]{3,}$/i', $postalInfoIntCity)) {
|
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\'\s]{2,}$/i', $postalInfoIntCity)) {
|
||||||
$this->container->get('flash')->addMessage('error', 'Unable to create contact: Invalid contact city');
|
$this->container->get('flash')->addMessage('error', 'Unable to create contact: Invalid contact city');
|
||||||
return $response->withHeader('Location', '/contact/create')->withStatus(302);
|
return $response->withHeader('Location', '/contact/create')->withStatus(302);
|
||||||
}
|
}
|
||||||
|
@ -880,7 +880,7 @@ class ContactsController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\s]{3,}$/i', $postalInfoIntCity)) {
|
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\'\s]{2,}$/i', $postalInfoIntCity)) {
|
||||||
$this->container->get('flash')->addMessage('error', 'Unable to update contact: Invalid contact city');
|
$this->container->get('flash')->addMessage('error', 'Unable to update contact: Invalid contact city');
|
||||||
return $response->withHeader('Location', '/contact/update/'.$identifier)->withStatus(302);
|
return $response->withHeader('Location', '/contact/update/'.$identifier)->withStatus(302);
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ function processContactCreate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\s]{3,}$/i', $postalInfoIntCity)) {
|
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\'\s]{2,}$/i', $postalInfoIntCity)) {
|
||||||
sendEppError($conn, $db, 2005, 'Invalid contact:city', $clTRID, $trans);
|
sendEppError($conn, $db, 2005, 'Invalid contact:city', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ function processContactUpdate($conn, $db, $xml, $clid, $database_type, $trans) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\s]{3,}$/i', $postalInfoIntCity)) {
|
if (preg_match('/(^\-)|(^\.)|(\-\-)|(\.\.)|(\.\-)|(\-\.)|(\-$)|(\.$)/', $postalInfoIntCity) || !preg_match('/^[a-z][a-z\-\.\'\s]{2,}$/i', $postalInfoIntCity)) {
|
||||||
sendEppError($conn, $db, 2005, 'Invalid contact:city', $clTRID, $trans);
|
sendEppError($conn, $db, 2005, 'Invalid contact:city', $clTRID, $trans);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue