Last modified: 2009-12-30 12:56:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T22503, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20503 - Handling of tel: URIs in SMW is broken
Handling of tel: URIs in SMW is broken
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Markus Krötzsch
http://semanticweb.org/index.php?titl...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-04 11:42 UTC by Richard Cyganiak
Modified: 2009-12-30 12:56 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Code for detecting phone numbers and validating tel URIs (5.93 KB, text/plain)
2009-09-04 11:44 UTC, Richard Cyganiak
Details

Description Richard Cyganiak 2009-09-04 11:42:55 UTC
Handling of tel: URIs, like for foaf:phone, is broken, as evident from the linked URL. Obviously there is some code that tries to turn arbitrary input into a valid URI, but it only tries to generate HTTP URIs, which gives funky results if a phone number was entered.

Entering a valid tel: URI also doesn't quite work, because the "+" character is escaped as "%2B" -- see the phone number of Richard Cyganiak in the linked page.

I've written some code to help fixing the issue. It's attached. It's not a patch, as I'm not familiar with SMW internals, but it should be helpful in fixing this issue. It consists of a function that

1. will take a string as input, 
2. will try to recognize if it's a phone number (written as a tel URI or simply as numbers),
3. will turn the phone number into a valid tel URI and return it,
4. or return null if it cannot be recognized as a phone number.

It's well-tested and closely follows the relevant RFC. I suggest adding this into the function that tries to generate valid URIs from user input.
Comment 1 Richard Cyganiak 2009-09-04 11:44:25 UTC
Created attachment 6530 [details]
Code for detecting phone numbers and validating tel URIs

Adding attachment
Comment 2 Markus Krötzsch 2009-12-30 12:56:16 UTC
The next version of SMW introduces a new datatype "Telephone number" based on your code. This should fix most problems with broken tel URIs in RDF export. The new code is already used on http://semanticweb.org and the RDF exports of that site should be updated within the next day.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links