Skip to content

Commit

Permalink
Merge #5464 and #5488 from 4.1 into 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed Sep 7, 2024
2 parents 2de348b + a3f5921 commit ce5d863
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,29 +173,17 @@ public void encodeEnd(FacesContext context, UIComponent component) throws IOExce
*/
private static boolean wasClicked(FacesContext context, UIComponent component, String clientId) {

// Was our command the one that caused this submission?
// we don' have to worry about getting the value from request parameter
// because we just need to know if this command caused the submission. We
// can get the command name by calling currentValue. This way we can
// get around the IE bug.

if (clientId == null) {
clientId = component.getClientId(context);
}

if (context.getPartialViewContext().isAjaxRequest()) {
return BEHAVIOR_SOURCE_PARAM.getValue(context).equals(clientId);
return RenderKitUtils.isPartialOrBehaviorAction(context, clientId);
} else {
Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();

if (requestParameterMap.get(clientId) == null) {

// Check to see whether we've got an action event
// as a result of a partial/behavior postback.
if (RenderKitUtils.isPartialOrBehaviorAction(context, clientId)) {
return true;
}

// Check to see whether we've got an action event from button of type="image"
StringBuilder builder = new StringBuilder(clientId);
String xValue = builder.append(".x").toString();
builder.setLength(clientId.length());
Expand Down
4 changes: 4 additions & 0 deletions impl/src/main/java/com/sun/faces/util/HtmlUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ private static int writeTextChar(Writer out, boolean escapeUnicode, boolean esca
// UNICODE entities: encode as needed
nextIndex = _writeDecRef(out, buff, buffIndex, buffLength, ch);
} else {
if (forXml && !isAllowedXmlCharacter(ch)) {
return buffIndex;
}

nextIndex = addToBuffer(out, buff, buffIndex, buffLength, ch);
}
}
Expand Down

0 comments on commit ce5d863

Please sign in to comment.