phpvms / phpvms_v2

Virtual Airline Management (not maintained)
http://www.phpvms.net
BSD 3-Clause "New" or "Revised" License
41 stars 46 forks source link

NavData.class.php replaces valid waypoint if it contains SID #121

Open nasserbq opened 10 years ago

nasserbq commented 10 years ago

The code in core / common / NavData.class.php supposedly strips out any occurrence of "SID" or "STAR" in the route. However, the function used is str_replace: $route_string = str_replace('SID', '', $route_string);

This causes valid waypoints such as "SIDAD" to be changed to AD with the "SID" part stripped. It caused our VA admin heartache until I dug into the issue.

Recommend perhaps using preg_replace() with regexp to avoid stripping "SID" or "STAR" only when they occur alone and not as a substring.

Thanks.

Oxymoron290 commented 10 years ago

I will verify the issue tomorrow evening. On Dec 15, 2013 5:45 PM, "nasserbq" notifications@github.com wrote:

The code in core / common / NavData.class.php supposedly strips out any occurrence of "SID" or "STAR" in the route. However, the function used is str_replace: $route_string = str_replace('SID', '', $route_string);

This causes valid waypoints such as "SIDAD" to be changed to AD with the "SID" part stripped. It drove our VA admin nuts for a while until I dug into the issue.

Recommend perhaps using preg_replace() with regexp to avoid stripping "SID" or "STAR" only when they occur alone and not as a substring.

Thanks.

— Reply to this email directly or view it on GitHubhttps://github.com/nshahzad/phpVMS/issues/121 .

nasserbq commented 9 years ago

Any updates on this issue?