	public function chmod($hash, $mode) {
		if ($this->commandDisabled('chmod')) {
			return $this->setError(elFinder::ERROR_PERM_DENIED);
		}

		if (!($file = $this->file($hash))) {
			return $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
		}

		if (!$this->options['allowChmodReadOnly']) {
			if (!$this->attr($this->decode($hash), 'write', null, ($file['mime'] === 'directory'))) {
				return $this->setError(elFinder::ERROR_PERM_DENIED, $file['name']);
			}
		}

		$path = $this->decode($hash);
		$write = $file['write'];

		if ($this->convEncOut(!$this->_chmod($this->convEncIn($path), $mode))) {
			return $this->setError(elFinder::ERROR_PERM_DENIED, $file['name']);
		}

		$this->clearcache();

		if ($file = $this->stat($path)) {
			$files = array($file);
			if ($file['mime'] === 'directory' && $write !== $file['write']) {
				foreach ($this->getScandir($path) as $stat) {
					if ($this->mimeAccepted($stat['mime'])) {
						$files[] = $stat;
					}
				}
			}
			return $files;
		} else {
			return $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
		}
	}
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.