Skip to content

Commit

Permalink
Merge branch 'hotfix-0.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-cues committed Aug 22, 2017
2 parents fe75dcd + d2447de commit 2219295
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.uniovi.nmapgui</groupId>
<artifactId>nmapGUI</artifactId>
<version>0.3-SNAPSHOT</version>
<version>0.3.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>NMapGUI</name>
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/com/uniovi/nmapgui/executor/CommandExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void run() {
String line = null;
cmd.getOutput().setText("<pre></pre>");
while ((line = reader.readLine()) != null) {
escape(line);
line=escape(line);
if (line.contains( " open "))
line="<span class=\"open\">"+line+"</span>";
else if (line.contains( " closed "))
Expand All @@ -58,7 +58,7 @@ else if (line.contains( " filtered "))
}
errorReader = new BufferedReader(new InputStreamReader(errors));
while ((line = errorReader.readLine()) != null) {
escape(line);
line=escape(line);
line="<span class=\"closed\">"+line+"</span>";
cmd.getOutput().setText(cmd.getOutput().getText().replaceAll("</pre>", "\n")+"<i>"+line+"</i></pre>");
}
Expand All @@ -85,11 +85,13 @@ else if (line.contains( " filtered "))
return true;
}

private void escape(String line) {
private String escape(String str) {
String line=str;
line = line.replace("&", "&amp;");
line = line.replace( "\"", "&quot;");
line = line.replace( "<", "&lt;");
line = line.replace( ">", "&gt;");
line = line.replace( ">", "&gt;");
return line;
}
public Command getCmd() {
return cmd;
Expand Down

0 comments on commit 2219295

Please sign in to comment.