| Summary: | Strange value of uninitialized input fields | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | Jan Halasa <jan.halasa> |
| Component: | khtml ecma | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | RedHat Enterprise Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Test case | ||
|
Description
Jan Halasa
2005-02-22 07:29:30 UTC
Created attachment 9769 [details]
Test case
The first text field is a reg exp, the second is a text to match it.
Reproduceable with 3.4rc1, works fine in firefox. Since this seems to be javascript related I moved it- HTMLInputValueImp::value() (html_formimpl.cpp) should never return a null DOMString(). Right now an invalid JS string object is created. CVS commit by porten:
value() should never return a null string.
BUGS:99970
M +6 -4 html_formimpl.cpp 1.421.2.3
--- kdelibs/khtml/html/html_formimpl.cpp #1.421.2.2:1.421.2.3
@@ -1559,10 +1559,12 @@ DOMString HTMLInputElementImpl::value()
}
+ DOMString val = m_value;
// It's important *not* to fall back to the value attribute for file inputs,
// because that would allow a malicious web page to upload files by setting the
// value attribute in markup.
- if (m_value.isNull() && m_type != FILE)
- return getAttribute(ATTR_VALUE);
- return m_value;
+ if (val.isNull() && m_type != FILE)
+ val = getAttribute(ATTR_VALUE);
+
+ return val.isNull() ? DOMString("") : val;
}
|