Closed Bug 420882 Opened 12 years ago Closed 12 years ago

Validate geos better

Categories

(Toolkit Graveyard :: Microformats, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mkaply, Assigned: mkaply)

References

()

Details

Attachments

(1 file, 2 obsolete files)

a latitude or longitude is a very defined value, so the microformats code should do a better job of knowing what is "correct"

This patch adds validation in to the geo code.

In the tests for this, I needed a way to succeed when we threw on creation. Hopefully I did this correctly.
Attachment #307251 - Flags: review?(sayrer)
Attached patch Fix some more edge cases (obsolete) — Splinter Review
Attachment #308644 - Flags: review?(sayrer)
I'm thinking too hard.

The best way to validate if a string is going to be a valid floating point after conversion is like this:

            if (!isNaN(the_string)) {
/* It's a valid floating point */
            }

new patch coming.
Attachment #307251 - Attachment is obsolete: true
Attachment #308644 - Attachment is obsolete: true
Attachment #308897 - Flags: review?(sayrer)
Attachment #307251 - Flags: review?(sayrer)
Attachment #308644 - Flags: review?(sayrer)
Attachment #308897 - Flags: review?(sayrer) → review+
Attachment #308897 - Flags: approval1.9?
Attachment #308897 - Flags: approval1.9? → approval1.9+
checked in.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.