id = cleanID($data['id'] ?? ''); if ($this->id === '') { throw new \InvalidArgumentException('Missing id'); } $this->revision = (int)($data['rev'] ?? $data['lastModified'] ?? @filemtime(wikiFN($this->id))); $this->size = (int)($data['size'] ?? @filesize(wikiFN($this->id))); $this->title = $data['title'] ?? $this->retrieveTitle(); $this->perms = $data['perm'] ?? auth_quickaclcheck($this->id); $this->hash = $data['hash'] ?? ''; } /** * Get the title for the page * * Honors $conf['useheading'] * * @return string */ protected function retrieveTitle() { global $conf; if ($conf['useheading']) { $title = p_get_first_heading($this->id); if ($title) { return $title; } } return $this->id; } }