Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replace weird characters in normalized name

Test Plan:
  bin/diviner .

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2181
  • Loading branch information...
commit b43b9a701a6eead09202a9cf8c4208eb279e18b4 1 parent 7eff8c8
vrana authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/renderer/default/DivinerDefaultRenderer.php
View
5 src/renderer/default/DivinerDefaultRenderer.php
@@ -137,9 +137,8 @@ public function markupTextInline($text) {
}
public function getNormalizedName($name) {
- // TODO: We should encode any weird characters so they become valid
- // in filesystem paths and URIs.
- $name = str_replace(' ', '_', $name);
+ $name = preg_replace('#[\\\\ *:?|/_]+#', '_', $name);
+ $name = rtrim($name, '_');
return $name;
}
Please sign in to comment.
Something went wrong with that request. Please try again.