Hey there, one little hack I did was to check the URL to see if the user entered it with http or https at the beginning and if not add http:// to the URL. I had to do this because in the past I had written a simple gift list for my family and even though I explained the http and that they could copy and paste from the site address, I still ended up manually fixing lots of URLs to add the http. I hacked that to do the http fix and it saved me much hassle so I figured I would head it off at the pass on this one too.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | wishlist.module.patch | 2.72 KB | add1sun |
Comments
Comment #1
scott.mclewin commentedCreate a patch for the change with diff -u and I'll incorporate your mod.
Comment #2
add1sun commentedHey Scott, I've made so many changes to the module at this point that a diff would be pretty wacked. I will need to get a clean copy, make just that mod and then do the diff. I'm also not very good at PHP so my mod may not be best form.
I'll try to get to making the diff this weekend if I have time.
Comment #3
scott.mclewin commentedThanks. With a pregnant wife on bedrest for (I hope) the next two months I have very limited time, so patches are helpful. I hope nobody thinks I've abandoned wishlist - I've not. I'm just at a rather busy spot in life.
Comment #4
scott.mclewin commentedI'm preparing to work on this module to clear down the issue queue in preparation for a D5 port. Please have patches in soon (mid December) if you want your changes incorporated into wishlist.module.
Comment #5
add1sun commentedOK, here is my first shot at doing a patch so please bear with me if I got it wrong. As I said I don't really know the best way to do things in PHP so also, please don't laugh. :)
Hope the wife and child are doing well.
Comment #6
scott.mclewin commentedYou did fine. After applying the patch and testing a bit I found that it was not covering cases where somebody entered HTTP:// (or mixed case protocol strings). I reworked it in the process of addressing that change and broke the core logic that you submitted into a function. I didn't feel like making the change four times. :)
Wife and child are great. We've reached term, much to our surprise and delight. Now our goal is to not have a child on Christmas day. :)
This is now fixed in HEAD, which is 4.7 compatible. I'll merge to the 4.7 branch after I've worked more of the issue queue.
Comment #7
scott.mclewin commentedforgot to update the state to fixed.
Comment #8
ziggyk commentedI believe this particular fix is causing my user's not to be able to enter items into the wishlist. After putting either a http:// address or non-http:// address they receive the following PHP error on their page:
Fatal error: Call to undefined function: stripos() in C:\Program Files\xampp\htdocs\modules\wishlist\wishlist.module on line 1448
Comment #9
scott.mclewin commentedZiggy,
Try the latest from HEAD. I'm using a PHP5 only function, stripos, in checking for http://. I've added a PHP4 compatible definition.
Scott
Comment #10
ziggyk commentedThis fixed my problem. Changing to fixed.
Comment #11
scott.mclewin commentedExcellent.
FYI there is a bug in core (for which I've submitted a patch) where it does not correctly handle creating links for URLs with any capital letters anywhere in the "http" or "https" portion of the URL. The wishlist module correctly handles the logic to automatically add the protocol component of the URL and saves it off, but core only wants all lower case, which is inconsistent with one of the RFCs.
http://drupal.org/node/105031
Closing this issue