[FEATURE] url parameter can be used to decode a diagram
for example : /plantuml/form?url=AqijAixCpmC0
This commit is contained in:
@@ -121,11 +121,12 @@ public class PlantUmlServlet extends HttpServlet {
|
|||||||
Transcoder transcoder = getTranscoder();
|
Transcoder transcoder = getTranscoder();
|
||||||
// the URL form has been submitted
|
// the URL form has been submitted
|
||||||
if (url != null && !url.trim().isEmpty()) {
|
if (url != null && !url.trim().isEmpty()) {
|
||||||
// Catch the last part of the URL
|
// Catch the last part of the URL if necessary
|
||||||
Matcher m1 = urlPattern.matcher(url);
|
Matcher m1 = urlPattern.matcher(url);
|
||||||
if (m1.find()) {
|
if (m1.find()) {
|
||||||
// Check it's a valid compressed text
|
|
||||||
url = m1.group(1);
|
url = m1.group(1);
|
||||||
|
}
|
||||||
|
// Check it's a valid compressed text
|
||||||
Matcher m2 = encodedPattern.matcher(url);
|
Matcher m2 = encodedPattern.matcher(url);
|
||||||
if (m2.find()) {
|
if (m2.find()) {
|
||||||
url = m2.group(0);
|
url = m2.group(0);
|
||||||
@@ -134,7 +135,6 @@ public class PlantUmlServlet extends HttpServlet {
|
|||||||
System.out.println("PlantUML ERROR Not a valid compressed string : " + url);
|
System.out.println("PlantUML ERROR Not a valid compressed string : " + url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// the Text form has been submitted
|
// the Text form has been submitted
|
||||||
if (text != null && !text.trim().isEmpty()) {
|
if (text != null && !text.trim().isEmpty()) {
|
||||||
encoded = transcoder.encode(text);
|
encoded = transcoder.encode(text);
|
||||||
|
|||||||
Reference in New Issue
Block a user