private String propertyName;
private String message;
+ // encode the '&' character in rap
+ private final static String AMPERSAND = "&";
+ private final static String AMPERSAND_REGEX = "&(?![#a-zA-Z0-9]+;)";
+
public EditablePropertyString(Composite parent, int style, Node node,
String propertyName, String message) throws RepositoryException {
super(parent, style, node, true);
if (EclipseUiUtils.isEmpty(text))
lbl.setText(message + " ");
else
- lbl.setText(text);
+ // TODO enhance this
+ lbl.setText(text.replaceAll(AMPERSAND_REGEX, AMPERSAND));
} else if (child instanceof Text) {
Text txt = (Text) child;
if (EclipseUiUtils.isEmpty(text)) {
if (name == null)
name = details.getFileName();
+
+ // TODO clean image name more carefully
+ String cleanedName = name.replaceAll("[^a-zA-Z0-9-.]", "_");
+
try {
- imageManager().uploadImage(context, name, stream);
+ imageManager().uploadImage(context, cleanedName, stream);
// TODO clean refresh strategy
section.getDisplay().asyncExec(new Runnable() {
@Override