Skip to content

Commit

Permalink
Fix str_replace ordering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgfnet committed Sep 19, 2019
1 parent 7f6c7e0 commit ee2afba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/sbb.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public function render() {
$where = $info["stationboard"][$i]["to"];
$attime = date('G:i', $info["stationboard"][$i]["stop"]["departureTimestamp"]);

$entrystr = str_replace($this->strformat, "{time}", $attime);
$entrystr = str_replace($entrystr, "{dest}", $where);
$entrystr = str_replace($entrystr, "{train}", $zug);
$entrystr = str_replace("{time}", $attime, $this->strformat);
$entrystr = str_replace("{dest}", $where, $entrystr);
$entrystr = str_replace("{train}", $zug, $entrystr);

$ret .= sprintf(
'<text x="%d" y="%d" fill="black" style="font-size: %dpx; font-style: %s; font-weight: bold;">%s</text>',
Expand Down

0 comments on commit ee2afba

Please sign in to comment.