Skip to content

Commit

Permalink
#31 fix for IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pieter Colpaert committed Aug 21, 2014
1 parent bee097d commit 41112cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/data/NMBS/stations.php
Expand Up @@ -52,6 +52,7 @@ public static function getStationFromID($id, $lang){
if(sizeof($idarray) > 0){
$id=$idarray[2];
}
$id = "BE.NMBS." . $id;
$station;
try {
$lang = mysql_real_escape_string(strtoupper($lang));
Expand Down Expand Up @@ -83,9 +84,9 @@ public static function getStationFromID($id, $lang){
*/
public static function getStationFromName($name, $lang){
//first check if it wasn't by any chance an id
if(substr($name,0,1) === "0" || substr($name,0,4) === "NMBS"){
$id=$name;
$idarray = explode(".",$id);
if(substr($name,0,1) === "0" || substr($name,0,6) === "BE.NMBS"){
$id = $name;
$idarray = explode(".",$id);
if(sizeof($idarray) > 0){
$id=$idarray[2];
}
Expand Down

0 comments on commit 41112cb

Please sign in to comment.