Skip to content

Commit

Permalink
[Fix JENKINS-13896] End marker must come after start marker.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Hansche committed May 29, 2012
1 parent 4a5a4b5 commit c03fa8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -9,7 +9,7 @@

<artifactId>confluence-publisher</artifactId>
<name>Confluence Publisher</name>
<description>Publish build argifacts to an Atlassian Confluence wiki</description>
<description>Publish build artifacts to an Atlassian Confluence wiki</description>
<version>1.6-SNAPSHOT</version>
<packaging>hpi</packaging>
<url>http://wiki.jenkins-ci.org/display/JENKINS/Confluence+Publisher+Plugin</url>
Expand Down
Expand Up @@ -42,15 +42,18 @@ public String performEdits(final BuildListener listener, final String content,
final StringBuffer sb = new StringBuffer(content);

final int start = content.indexOf(startMarkerToken) + startMarkerToken.length();
final int end = content.indexOf(endMarkerToken);

if (start < 0) {
throw new TokenNotFoundException(
"Start-marker token could not be found in the page content: "
+ startMarkerToken);
} else if (end < 0) {
}

final int end = content.indexOf(endMarkerToken, start);

if (end < 0) {
throw new TokenNotFoundException(
"End-marker token could not be found in the page content: " + endMarkerToken);
"End-marker token could not be found after the start-marker token: " + endMarkerToken);
}

// Remove the entire marked section (exclusive)
Expand Down

0 comments on commit c03fa8b

Please sign in to comment.