Simplify get_name even further

This commit is contained in:
ruan 2016-10-04 01:47:31 +02:00
parent 25b147de9a
commit ee53e992a4
No known key found for this signature in database
GPG Key ID: 062534EE618F498C

View File

@ -221,14 +221,12 @@ class Page {
}
if (array_key_exists($uuid, $this->uuid_name_cache)) return $this->uuid_name_cache[$uuid];
$history = $this->settings->table['history'];
$stmt = $this->conn->prepare("SELECT name FROM $history WHERE uuid=? ORDER BY date DESC LIMIT 1");
$result = null;
$history = $this->settings->table['history'];
$stmt = $this->conn->prepare("SELECT name FROM $history WHERE uuid=? ORDER BY date DESC LIMIT 1");
if ($stmt->execute(array($uuid)) && $row = $stmt->fetch()) {
$name = $row['name'];
$this->uuid_name_cache[$uuid] = $name;
$result = $name;
$result = $row['name'];
}
$stmt->closeCursor();