Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When editing a user, an error message is given:
Deprecated function: Function ereg() is deprecated in logintoboggan_validate_pass() (line 1063 of ... \sites\all\modules\logintoboggan\logintoboggan.module).
Not sure if the pattern can be literally changed to a preg pattern.
Using Drupal 7 Alpha 5.
Comment | File | Size | Author |
---|---|---|---|
#11 | logintoboggan-838826.patch | 998 bytes | 1sp |
#8 | lt_ereg_to_preg_match.patch | 983 bytes | hunmonk |
Comments
Comment #1
nunof CreditAttribution: nunof commentedComment #2
1sp CreditAttribution: 1sp commentedplease confirm if you are using php5.3+ . seems like it is the cause of the deprecated warning.
Comment #3
hunmonk CreditAttribution: hunmonk commentedComment #4
nunof CreditAttribution: nunof commentedYes, indeed.
I'm running PHP 5.3.1.
Comment #5
1sp CreditAttribution: 1sp commentedPlease downgrade php to 5.2.x. Read this for more information http://drupal.org/requirements
Comment #6
hunmonk CreditAttribution: hunmonk commentedactually, i think we'll need to support PHP 5.3 for the 7.x version...
in any case, a deprecation warning is not critical -- things should function just fine.
Comment #7
1sp CreditAttribution: 1sp commentedok, I just came across this http://drupal.org/node/360605 which show an work in progress patch for php5.3 compatibility.
Comment #8
hunmonk CreditAttribution: hunmonk commentedaccording to http://devthought.com/tumble/2009/06/fix-ereg-is-deprecated-errors-in-ph... attached patch should fix the issue. any regex wizards want to confirm my work before i commit?
Comment #9
1sp CreditAttribution: 1sp commentedI just tried the patch, it seems to be working.
wondering if those two preg_match statements may be combined into one (line 1063-1064, logintoboggn.module).
Comment #10
hunmonk CreditAttribution: hunmonk commentedi didn't originally write that section of code. if they can be combined, feel free to combine them and submit a patch :)
Comment #11
1sp CreditAttribution: 1sp commentedpatch attached :)
Comment #12
hunmonk CreditAttribution: hunmonk commentedi'm a little bit confused about this latest patch. it doesn't appear to address the same character sequences, and the [:graph:] and space characters seem to be missing. have these somehow been incorporated into the new character sequence?
Comment #13
Rj-dupe-1 CreditAttribution: Rj-dupe-1 commentedConfirm patch makes the error go away on D7b2 & PHP5.3 with no apparent ill effects.
Comment #14
hunmonk CreditAttribution: hunmonk commented@sudhirporwal: i need an answer to my question in #12 before i can proceed with this fix.
Comment #15
1sp CreditAttribution: 1sp commented[edited to make the explanation correct]
@hunmonk
while merging them into one preg sequence , I have aggregated everything into a +ve match, hence making [:graph:] character class unnecessary. The aggregated sequence only checks for the unnecessary charaters
To be honest , As per best of my knowledge this code works. I have tested the patch many times and can confirm that it does stop commonly used invalid characters in the passwords.
One unrelated question, even though I am member of the project, how come I don't get email notifications when an issue gets a reply. Please help me with this, as I assume I am doing something very silly here.
Comment #16
1sp CreditAttribution: 1sp commentedthe [:graph:] character class does include the valid characters, so we need not to check for its inclusion
Comment #17
hunmonk CreditAttribution: hunmonk commentedcommitted to HEAD, 6.x-1.x-dev, and 5.x-1.x-dev -- thanks!
@sudhirporwal: for issue emails, check your subscription settings for the project at http://drupal.org/project/issues/subscribe-mail/logintoboggan