Changeset View
Changeset View
Standalone View
Standalone View
src/applications/console/controller/DarkConsoleDataController.php
| Show All 27 Lines | public function processRequest() { | ||||
| $cache = new PhutilKeyValueCacheProfiler($cache); | $cache = new PhutilKeyValueCacheProfiler($cache); | ||||
| $cache->setProfiler(PhutilServiceProfiler::getInstance()); | $cache->setProfiler(PhutilServiceProfiler::getInstance()); | ||||
| $result = $cache->getKey('darkconsole:'.$this->key); | $result = $cache->getKey('darkconsole:'.$this->key); | ||||
| if (!$result) { | if (!$result) { | ||||
| return new Aphront400Response(); | return new Aphront400Response(); | ||||
| } | } | ||||
| $result = json_decode($result, true); | try { | ||||
| $result = phutil_json_decode($result); | |||||
| if (!is_array($result)) { | } catch (PhutilJSONParserException $ex) { | ||||
| return new Aphront400Response(); | return new Aphront400Response(); | ||||
| } | } | ||||
| if ($result['vers'] != DarkConsoleCore::STORAGE_VERSION) { | if ($result['vers'] != DarkConsoleCore::STORAGE_VERSION) { | ||||
| return new Aphront400Response(); | return new Aphront400Response(); | ||||
| } | } | ||||
| if ($result['user'] != $user->getPHID()) { | if ($result['user'] != $user->getPHID()) { | ||||
| Show All 38 Lines | |||||