]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3755 Escape issue message
authorJulien Lancelot <julien.lancelot@gmail.com>
Thu, 18 Apr 2013 16:38:06 +0000 (18:38 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Thu, 18 Apr 2013 16:38:06 +0000 (18:38 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_issue.html.erb
sonar-ws-client/src/main/java/org/sonar/wsclient/services/Issue.java

index 1049937922eeb53f5f2e87b9469a50f6ef1a489a..9593d9e8f39a8762709ac6a36a5bcfdbc206211f 100644 (file)
@@ -70,7 +70,8 @@
 
     <div class="discussionComment first">
       <div id="vMsg<%= issue.key -%>">
-        <%= issue.message || '&nbsp;' -%>
+        <% issue_message = issue.message ? Api::Utils.split_newlines(h(issue.message)).join('<br/>') : '' %>
+        <%= issue_message || '&nbsp;' -%>
       </div>
     </div>
 
index 09c5d06e50c4be2dfa0626d07922f4549c73ed2d..cc6314d18d5501ca489f6959a6edd4f47d990675 100644 (file)
@@ -28,8 +28,8 @@ public class Issue extends Model {
 
   private String key;
   private String componentKey;
-  private String ruleKey;
   private String ruleRepositoryKey;
+  private String ruleKey;
   private String severity;
   private String title;
   private String message;
@@ -61,21 +61,21 @@ public class Issue extends Model {
     return this;
   }
 
-  public String getRuleKey() {
-    return ruleKey;
+  public String getRuleRepositoryKey() {
+    return ruleRepositoryKey;
   }
 
-  public Issue setRuleKey(String ruleKey) {
-    this.ruleKey = ruleKey;
+  public Issue setRuleRepositoryKey(String ruleRepositoryKey) {
+    this.ruleRepositoryKey = ruleRepositoryKey;
     return this;
   }
 
-  public String getRuleRepositoryKey() {
-    return ruleRepositoryKey;
+  public String getRuleKey() {
+    return ruleKey;
   }
 
-  public Issue setRuleRepositoryKey(String ruleRepositoryKey) {
-    this.ruleRepositoryKey = ruleRepositoryKey;
+  public Issue setRuleKey(String ruleKey) {
+    this.ruleKey = ruleKey;
     return this;
   }
 
@@ -190,9 +190,22 @@ public class Issue extends Model {
   @Override
   public String toString() {
     return new StringBuilder()
-        .append(key)
+      .append("[key=").append(key).append("], ")
+      .append("[componentKey=").append(componentKey).append("], ")
+      .append("[ruleRepositoryKey=").append(ruleRepositoryKey).append("], ")
+      .append("[ruleKey=").append(ruleKey).append("], ")
+      .append("[severity=").append(severity).append("], ")
+      .append("[title=").append(title).append("], ")
+      .append("[message=").append(message).append("], ")
+      .append("[line=").append(line).append("], ")
+      .append("[cost=").append(cost).append("], ")
+      .append("[status=").append(status).append("], ")
+      .append("[resolution=").append(resolution).append("], ")
+      .append("[userLogin=").append(userLogin).append("], ")
+      .append("[assigneeLogin=").append(assigneeLogin).append("], ")
+      .append("[createdAt=").append(createdAt).append("], ")
+      .append("[updatedAt=").append(updatedAt).append("], ")
+      .append("[closedAt=").append(closedAt).append("]")
         .toString();
   }
-
-
 }