Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phlux/controller/PhluxEditController.php
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | public function processRequest() { | ||||
$value = $var->getVariableValue(); | $value = $var->getVariableValue(); | ||||
if ($request->isFormPost()) { | if ($request->isFormPost()) { | ||||
if ($is_new) { | if ($is_new) { | ||||
$key = $request->getStr('key'); | $key = $request->getStr('key'); | ||||
if (!strlen($key)) { | if (!strlen($key)) { | ||||
$errors[] = pht('Variable key is required.'); | $errors[] = pht('Variable key is required.'); | ||||
$e_key = pht('Required'); | $e_key = pht('Required'); | ||||
} else if (!preg_match('/^[a-z0-9.-]+$/', $key)) { | } else if (!preg_match('/^[a-z0-9.-]+\z/', $key)) { | ||||
$errors[] = pht( | $errors[] = pht( | ||||
'Variable key "%s" must contain only lowercase letters, digits, '. | 'Variable key "%s" must contain only lowercase letters, digits, '. | ||||
'period, and hyphen.', | 'period, and hyphen.', | ||||
$key); | $key); | ||||
$e_key = pht('Invalid'); | $e_key = pht('Invalid'); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |