Last modified: 2013-02-20 21:49:34 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 T47069, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45069 - PHP Notice: Undefined index: path in wfParseUrl function in mailto:?subject= URLs
PHP Notice: Undefined index: path in wfParseUrl function in mailto:?subject= ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.20.x
All All
: Low trivial (vote)
: 1.21.0 release
Assigned To: Alexandre Emsenhuber [IAlex]
https://www.mediawiki.org/wiki/Thread...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-16 10:39 UTC by Jesús Martínez Novo (Ciencia Al Poder)
Modified: 2013-02-20 21:49 UTC (History)
3 users (show)

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


Attachments

Description Jesús Martínez Novo (Ciencia Al Poder) 2013-02-16 10:39:53 UTC
According to the forum thread linked from this bug, when inserting a mailto: url without email address but with a query string it gives a PHP notice.

For example:

mailto:?subject=Visit%20this%20website!&body=asdad

This URL syntax makes the mail program to create a new message without TO: address but with the subject and body defined, useful to give users an easy way to generate an email template for sharing.

This is the solution proposed on the forum thread: "Testing for isset( $bits['path'] ) at GlobalFunctions.php line 755 corrects the error."

 /* parse_url loses the third / for file:///c:/ urls (but not on variants) */
 if (  isset( $bits['path'] ) ) {  /* new */
     if ( substr( $bits['path'], 0, 1 ) !== '/' ) {
         $bits['path'] = '/' . $bits['path'];
     }
 }  else {   /* new */
     $bits['path'] = '';
 }
Comment 1 Alexandre Emsenhuber [IAlex] 2013-02-18 12:23:13 UTC
Gerrit change #49642
Comment 2 Alexandre Emsenhuber [IAlex] 2013-02-20 15:49:16 UTC
Change merged.
Comment 3 Krinkle 2013-02-20 21:49:34 UTC
@IAlex: Can you provide a test as well?

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


Navigation
Links