diff --git a/includes/PTStop.php b/includes/PTStop.php index 15b3385..90788df 100644 --- a/includes/PTStop.php +++ b/includes/PTStop.php @@ -1,17 +1,21 @@ ref . ']'; } - + public function getExists () { if (!$this->infoFetched) $this->fetchInfo(); return $this->exists; @@ -32,28 +36,28 @@ if (!$this->infoFetched) $this->fetchInfo(); return $this->location; } - + protected function fetchInfo () { - + $apireq = new ApiCoreRequest('haltes/titel/' . $this->ref); $response = $apireq->exec(); $this->exists = !is_null($response); - + $this->municipality = $response['omschrijvingGemeente']; - $this->name = $response['omschrijvingKort']; - $this->fullName = $response['omschrijvingLang']; + $this->name = static::sanitizeName($response['omschrijvingKort']); + $this->fullName = static::sanitizeName($response['omschrijvingLang']); $this->location = array(floatval($response['coordinaat']['lt']), floatval($response['coordinaat']['ln'])); - + } - + public function getImminentVehicles ($numberOfLines) { - + $apireq = new ApiCoreRequest('haltes/doorkomstenditmoment/' . $this->ref . '/' . $numberOfLines); return $apireq->exec(); - + } - + } - + ?> diff --git a/includes/ResultsInterface.php b/includes/ResultsInterface.php index b96f374..e929feb 100644 --- a/includes/ResultsInterface.php +++ b/includes/ResultsInterface.php @@ -38,7 +38,7 @@ echo ''; - echo '' . $stop['omschrijvingLang'] . ' '; + echo '' . PTStop::sanitizeName($stop['omschrijvingLang']) . ' '; echo '(' . $stop['halteNummer'] . ')'; if (isset($stop['bestemmingen'][0])) { echo 'richting ' . parent::listify($stop['bestemmingen']) . '';