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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nunof’s picture

Title: Warning saving user profile » Warning when saving user profile
1sp’s picture

please confirm if you are using php5.3+ . seems like it is the cause of the deprecated warning.

hunmonk’s picture

Status: Active » Postponed (maintainer needs more info)
nunof’s picture

Status: Postponed (maintainer needs more info) » Active

Yes, indeed.

I'm running PHP 5.3.1.

1sp’s picture

Status: Active » Closed (won't fix)

Please downgrade php to 5.2.x. Read this for more information http://drupal.org/requirements

hunmonk’s picture

Priority: Normal » Minor
Status: Closed (won't fix) » Active

actually, 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.

1sp’s picture

Priority: Minor » Normal

ok, I just came across this http://drupal.org/node/360605 which show an work in progress patch for php5.3 compatibility.

hunmonk’s picture

Status: Active » Needs review
FileSize
983 bytes

according 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?

1sp’s picture

Status: Needs review » Needs work

I 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).

hunmonk’s picture

i didn't originally write that section of code. if they can be combined, feel free to combine them and submit a patch :)

1sp’s picture

Status: Needs work » Needs review
FileSize
998 bytes

patch attached :)

hunmonk’s picture

Status: Needs review » Postponed (maintainer needs more info)

i'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?

Rj-dupe-1’s picture

Status: Postponed (maintainer needs more info) » Needs review

Confirm patch makes the error go away on D7b2 & PHP5.3 with no apparent ill effects.

hunmonk’s picture

Status: Needs review » Postponed (maintainer needs more info)

@sudhirporwal: i need an answer to my question in #12 before i can proceed with this fix.

1sp’s picture

Status: Postponed (maintainer needs more info) » Needs review

[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.

1sp’s picture

the [:graph:] character class does include the valid characters, so we need not to check for its inclusion

hunmonk’s picture

Title: Warning when saving user profile » ereg deprecated in PHP 5.3, remove from password checking function
Status: Needs review » Fixed

committed 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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.