Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phlux/controller/PhluxEditController.php
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | if ($request->isFormPost()) { | ||||
'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'); | ||||
} | } | ||||
} | } | ||||
$raw_value = $request->getStr('value'); | $raw_value = $request->getStr('value'); | ||||
$value = json_decode($raw_value, true); | $value = phutil_json_decode($raw_value); | ||||
if ($value === null && strtolower($raw_value) !== 'null') { | if ($value === null && strtolower($raw_value) !== 'null') { | ||||
$e_value = pht('Invalid'); | $e_value = pht('Invalid'); | ||||
$errors[] = pht('Variable value must be valid JSON.'); | $errors[] = pht('Variable value must be valid JSON.'); | ||||
$display_value = $raw_value; | $display_value = $raw_value; | ||||
} | } | ||||
if (!$errors) { | if (!$errors) { | ||||
$editor = id(new PhluxVariableEditor()) | $editor = id(new PhluxVariableEditor()) | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |