public function process() { /* get base paths and sanitize incoming paths */ $filePath = rawurldecode($this->getProperty('file', '')); $loaded = $this->getSource(); if (!$this->source instanceof modMediaSource) { return $loaded; } $path = $this->source->updateObject($filePath, $this->getProperty('content')); if (empty($path)) { $msg = ''; $errors = $this->source->getErrors(); foreach ($errors as $k => $msg) { $this->addFieldError($k, $msg); } return $this->failure($msg); } return $this->success('', array('file' => $path)); }