Kaynağa Gözat

Updated the code to make sure the raw error message is shown properly when the language is set to Hebrew.

Just a note for testing, you must first enable "Show Detailed Error Messages" before you will be able to see the extended error messages, with the low-level error numbers.

To do this:
• Login to SSPR, and launch the Configuration Editor.
• Type the password, and click the "Sign In" button.
• Navigate to: Settings > Security > Application Security, and make sure "Show Detailed Error Messages" is enabled.

Here are the scenarios I have fixed and verified in Hebrew:

Login page:
• Use an invalid username
• Use a valid username and an invalid password

Forgotten Password page:
• Use an invalid username
• Use a valid username, but use invalid answers on the next page
James Albright 7 yıl önce
ebeveyn
işleme
7e31b2daf3

+ 1 - 1
server/src/main/java/password/pwm/http/tag/ErrorMessageTag.java

@@ -79,7 +79,7 @@ public class ErrorMessageTag extends PwmAbstractTag {
                 if (showErrorDetail) {
                     final String errorDetail = error.toDebugStr() == null ? "" : " { " + error.toDebugStr() + " }";
                     // detail should always be escaped - it may contain untrusted data
-                    outputMsg += StringUtil.escapeHtml(errorDetail);
+                    outputMsg += "<span class='errorDetail'>" + StringUtil.escapeHtml(errorDetail) + "</span>";
                 }
 
                 outputMsg = outputMsg.replace("\n","<br/>");

+ 1 - 1
server/src/main/webapp/public/resources/js/main.js

@@ -657,7 +657,7 @@ PWM_MAIN.showErrorDialog = function(error, options) {
         body += error['errorMessage'];
         logMsg += error['errorCode'] + "," + error['errorMessage'];
         if (error['errorDetail']) {
-            body += "<br/><br/><div style='max-height: 250px; overflow-y: auto'>" + error['errorDetail'] + '</div>';
+            body += "<br/><br/><div class='errorDetail' style='max-height: 250px; overflow-y: auto'>" + error['errorDetail'] + '</div>';
             logMsg += ", detail: " + error['errorDetail'];
         }
     } else {

+ 11 - 1
server/src/main/webapp/public/resources/style.css

@@ -1253,4 +1253,14 @@ html[dir="rtl"] .nihilo .dijitTabContainerTop-tabs > .dijitTabContent:first-chil
     height: 50px;
     position: relative;
     z-index:1003;
-}
+}
+
+html[dir="rtl"] .errorDetail {
+    direction: ltr;
+    text-align: right;
+    unicode-bidi: bidi-override;
+}
+
+html[dir="rtl"] .message.message-error .errorDetail {
+    display: inline-block;
+}