I have just upgraded to Drupal 6.17 and now for the first time got the following warning after saving a modified article:
warning: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 10 in /srv/www/vhosts/winhlp.com/httpdocs/modules/user/user.module on line 393.
System status report:
Drupal: 6.17
Access to update.php: Protected
CAPTCHA: Already 5304 blocked form submissions
Configuration file: Protected
Cron maintenance tasks: Last run 33 min 40 sec ago
You can run cron manually.
Database updates: Up to date
Drupal core update status: Up to date
File system: Writable (public download method)
GD library: bundled (2.0.28 compatible)
Module and theme update status: Up to date
MySQL database: 5.0.18
PHP: 5.1.2
PHP memory limit: 256M
PHP register globals: Disabled
Unicode library: PHP Mbstring Extension
Update notifications: Enabled
Web server: Apache/2.2.0 (Linux/SUSE)
Comment | File | Size | Author |
---|---|---|---|
#18 | do820336-utf8-pregmatch-D6.patch | 989 bytes | Heine |
#17 | do820336-utf8-pregmatch-D7.patch | 1.25 KB | Heine |
#9 | do820336-utf8-preg-D6.patch | 600 bytes | Heine |
#9 | do820336-utf8-preg-D7.patch | 600 bytes | Heine |
Comments
Comment #1
idcm CreditAttribution: idcm commentedGot the same error when removing a role from a user. Just updated to 6.17. I don't see anything in the server logs. Site logs say:
Type php
Date Wednesday, June 9, 2010 - 07:25
User admin1
Location http://sitename.com/user/14/edit?destination=admin%2Fuser%2Fuser
Referrer http://sitename.com/user/14/edit?destination=admin%2Fuser%2Fuser
Message preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 10 in /home/idcmi/sitename.com/html/modules/user/user.module on line 393.
Severity error
Comment #2
hoisoftware CreditAttribution: hoisoftware commentedBrand new install on site.
The only item of note is that I extract to 'drupal-6.17' and then sym-link using 'drupal' then run the install/setup from {site}/drupal/
Site is currently switching from and installed TikiWiki over to Drupal, but I don't see how the 2 could be related. Different folders and different DB's.
------------------------
Drupal installation complete
warning: Compilation failed: range out of order in character class at offset 10 in /var/www/vhosts/{domain}/httpdocs/drupal-6.17/modules/user/user.module on line 393.
Congratulations, Drupal has been successfully installed.
Please review the messages above before continuing on to your new site.
------------------------
Details
Type php
Date Wednesday, June 9, 2010 - 10:11
User Anonymous
Location http://www.{domain}/drupal/install.php?locale=en&profile=default
Referrer http://www.{domain}/drupal/install.php?locale=en&profile=default
Message Compilation failed: range out of order in character class at offset 10 in /var/www/vhosts/{domain}/httpdocs/drupal-6.17/modules/user/user.module on line 393.
Severity error
Hostname {IP}
Operations
-------------------------
Drupal 6.17
Access to update.php Protected
Configuration file Protected
Cron maintenance tasks Last run 3 min 40 sec ago
You can run cron manually.
Database updates Up to date
Drupal core update status Up to date
File system Writable (public download method)
GD library bundled (2.0.28 compatible)
MySQL database 4.1.20
PHP 4.3.9
PHP memory limit 32M
PHP register globals Disabled
Unicode library PHP Mbstring Extension
Update notifications Enabled
Web server Apache/2.0.52 (CentOS)
Comment #3
Heine CreditAttribution: Heine commentedThis is due to a change in user validation in #266488: Cleanup for user_validate_name() + tests.
Treatment of the \x{} syntax might not be entirely consistent among PHP versions.
Can you replace
with
or
and post the results here?
Comment #4
Heine CreditAttribution: Heine commentedComment #5
hoisoftware CreditAttribution: hoisoftware commentedProblem was apparent when updating the user details. Made change to 1st option (adding the u) and that seems to have cured it. I will update here if it seems to rear it's head again.
Thanks.
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud commented@hoisoftware: this PHP version is way outdated, and I think Drupal 6 only support PHP 4.4.0 and higher. You should really consider upgrading before doing anything.
Comment #7
Irous CreditAttribution: Irous commentedHi, I'm getting the same error message when I update any user profiles on the site.
I've updated half of my Drupal sites to v6.17 (from v6.16), and noticed in one of them that when I updated my user profile, I received this error:
warning: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 10 in /var/www/vhosts/mysite.com/httpdocs/modules/user/user.module on line 393.
I've checked on all my recently updated v6.17 sites, and it occurs on all of them. You don't need to change any of your details either, just go edit user and click save and the error above occurs. I did a quick check on all my v6.16 sites, and the error does not occur.
I'm on PHP 5.2.9
Comment #8
IntoTheWoods CreditAttribution: IntoTheWoods commentedSame error on fresh install of 6.17 with PHP 5.05.
Comment #9
Heine CreditAttribution: Heine commentedWhat version of PCRE are you using?
Comment #11
Lancezh CreditAttribution: Lancezh commentedExact Same Problem here, fresh clean install of Drupal 6.17 5 days ago:
Drupal 6.17
Access to update.php Protected
Configuration file Protected
Cron maintenance tasks Last run 41 min 56 sec ago
You can run cron manually.
Database updates Up to date
Drupal core update status No update data available
No information is available about potential new releases for currently installed modules and themes. To check for updates, you may need to run cron or you can check manually. Please note that checking for available updates can take a long time, so please be patient.
File system Writable (public download method)
MySQL database 4.1.10a
PHP 4.3.10
PHP memory limit 80M
PHP register globals Disabled
Unicode library PHP Mbstring Extension
Update notifications Enabled
Web server Apache
Comment #12
Mark Nielsen CreditAttribution: Mark Nielsen commentedI am also getting this warning message when I edit a user account. I don't even have to change anything—just clicking "Edit" on a user, and then "Save" with no changes will cause the warning. In spite of the warning, Drupal appears to be making any changes to user accounts as normal—so data seems safe.
The bug appeared for me after upgrading a site to Drupal 6.17. Should this issue have it's version changed to 6.17?
The relatvant details of my installation are as follows:
Comment #13
idcm CreditAttribution: idcm commentedHeine, I just inserted the second patch option you provided and so far it works. I can save my user and don't get an error. I will let you know if it stops working for some reason. I am running PHP 5.2.5 if that helps anyone. thanks Heine.
Comment #14
idcm CreditAttribution: idcm commentedMyabe I am repeating #11 but I just installed Acquia's Drupal profile and when I submitted the last step of the install process, I got the error when the first user was created. So this is not limited to editing users.
Comment #15
idcm CreditAttribution: idcm commentedokay, patched the acquia drupal profile with
And ran another install and no error when user1 was created in install.
Comment #16
tstasiojr CreditAttribution: tstasiojr commentedHeine, I had exactly the same problem and your suggestion fixed it (the first suggestion of the two).
In module/user/user.module I added the u just after /i and my problem has gone away.
hoisoftware and damien: I'm running PHP v5.0.5. I tried upgrading PHP before I found this thread and had major problems with PHP 5.3. I discovered in another forum that Drupal isn't ready for 5.3 yet...
Thanks everyone.
Comment #17
Heine CreditAttribution: Heine commentedRunning
^\x{80}-\x{F7}
in UTF-8 mode doesn't make sense; after all, there is no valid single byte 'character' with the value 0x80.The original expression in D6 seems to be intended to filter out illegal byte sequences; At best, it should be \x80-\xF7, but I've adapted the rather broad range to also balk on overlong encoding (C0-C2). The modification keeps the original support for 4 byte codepoints above 10FFFF.
Comment #18
Heine CreditAttribution: Heine commentedDrupal 6 patch.
Comment #19
dddave CreditAttribution: dddave commentedMarked #825654: Updating user profile results in error message as a dupe.
Comment #21
slead CreditAttribution: slead commentedHi Heine,
I'm a total Drupal newbie (I just tried installing Drupal 6.17 with Apache2Triad 1.5.4) and I'm getting this error message after installation.
Can you please point me to instructions on how to install/apply the patch you just posted?
Thanks,
Steve
Comment #22
dddave CreditAttribution: dddave commentedhttp://drupal.org/patch/apply
Also worth a look: http://drupal.org/node/317
Comment #23
slead CreditAttribution: slead commentedHi ddave,
Thanks for the tip. I'm trying the patchwin.bat method listed at http://drupal.org/node/75790#comment-2615716 but this hasn't worked for me.
I downloaded the file from #18 above and placed it at C:\Temp\drupal\do820336-utf8-pregmatch-D6.patch then attempted to run this file, specifying the patch.bat as the program to run. The error message I get in the command prompt appears below. Is this something you can help with?
Is this bug specific to version 6.1.7? I'm only experimenting with Drupal so I could easily install another version if so.
Thanks,
Steve
C:\Temp\drupal>"C:\Program Files\GnuWin32\bin\unix2dos" -v "C:\Temp\drupal\do820336-utf8-pregmatch-D6.patch"
unix2dos: Converting C:\Temp\drupal\do820336-utf8-pregmatch-D6.patch
C:\Temp\drupal>"C:\Program Files\GnuWin32\bin\patch" --verbose 0<"C:\Temp\drupal\do820336-utf8-pregmatch-D6.patch"
Hmm... Looks like a unified diff to me...
can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git modules/user/user.module modules/user/user.module
|index e8b1fe2..48dc5dc 100644
|--- modules/user/user.module
|+++ modules/user/user.module
--------------------------
File to patch:
Comment #24
timbraeckman CreditAttribution: timbraeckman commentedI've added the "u" like in post #3 and no errors anymore! Thanks!!
Comment #25
robsonhell@gmail.com CreditAttribution: robsonhell@gmail.com commentedO patch para D6 funcionou comigo.
Comment #26
dddave CreditAttribution: dddave commented@#25
Please post in English!
@all
#25 confirmes that the patch in #18 is working fine. (Thanks to google translate.)
Comment #27
madth3 CreditAttribution: madth3 commentedPatch #18 worked for me too in Drupal 6.17
Comment #28
rnyberg CreditAttribution: rnyberg commentedConfirm adding the /u option to the regexp successfull.
Comment #29
Heine CreditAttribution: Heine commentedThe /u option is not a viable addition. Please test the patch.
Comment #30
hgmichna CreditAttribution: hgmichna commentedDid the patch make it into Drupal 6.19?
Comment #31
Heine CreditAttribution: Heine commented@#30: no, the patch is still marked "needs review"
Comment #32
Heine CreditAttribution: Heine commentedRestoring metadata.
Comment #33
bkoopmans CreditAttribution: bkoopmans commentedHas anyone tried any of these patches/solutions on 6.19?
Comment #34
Heine CreditAttribution: Heine commentedPlease stop changing versions.
This bug should be fixed on D7 first (we have tests there), then backported (done so preemptively) to D6.
Comment #35
bkoopmans CreditAttribution: bkoopmans commentedI apologize for changing the version. I applied the patch suggested in post # 18 and it resolved the problems, however, I was then no longer able to get any but the front page to show for users signing on using IE8 on a Windows 7 machine. IE8 worked fine on XP and the problem did not show up running FireFox 3.6.7 on Centos.
Comment #36
kleinetony CreditAttribution: kleinetony commentedsame problem, started with update to 6.19
Comment #37
idcm CreditAttribution: idcm commentedI just ran install for D6.19 without the patch and got the error. Ran install again with the patch and did not get the error. So far, I am assuming it works.
c
Comment #38
guignonv CreditAttribution: guignonv commentedI updated from Drupal 6.16 to 6.19 and I had that error.
I tested the path #17 on my Drupal 6.19 PHP 5.1.6. I don't have the error anymore.
By the way, I have another problem that might not be related but which is still there: I'm unable to log in! :-S I'll see if that issue has already been reported.
[update:] I saw other people had the same issue and the "fix" was to (...RTFM ;-) ) create a $cookie_domain entry in the settings.php.
Comment #39
Heine CreditAttribution: Heine commentedComment #40
davistv CreditAttribution: davistv commentedJust applied this to an install of 6.19 after already configuring several modules, then hitting the error when adding roles to modules. Patch appears to have worked as intended, though. Doesn't look like I'll need to do a clean install or anything like that.
Comment #41
Heine CreditAttribution: Heine commentedNeeds to be fixed in 7 first, then in 6.
Comment #42
Heine CreditAttribution: Heine commentedComment #43
Heine CreditAttribution: Heine commentedConfirming whether a patch "works" (or seems to work) is only one step in the review process before a patch can attain the status "reviewed and tested by the community".
See http://drupal.org/patch/review for more.
Also, please keep the focus on 7.x-dev as it needs to be fixed there first.
Comment #44
hepabolu CreditAttribution: hepabolu commentedFYI: I've downloaded and installed Drupal 7.0 3 days ago.
On my local machine (OSX PHP 5.3.2) everything works fine, no error.
On my website (copy of the local installation, shared linux hosting, PHP 5.2.17) I get the above error, but everything works.
Comment #45
dozymoe CreditAttribution: dozymoe commentedI found http://www.phpwact.org/php/i18n/utf-8#i_pcre_caseless_pattern_modifier to be informative.
It said unless /u is specified the server's locale is used. Which is probably ASCII and not UNICODE.
Comment #46
Heine CreditAttribution: Heine commentedThis is intentional as we are checking bytes, not characters. Another approach is to use preg_match with the /u modifier to check for UTF-8 validity of the provided string vs. the original code that checks for certain invalid bytes.
Comment #47
TechNikh CreditAttribution: TechNikh commentedI am getting same error
My System status report:
PHP 5.1.6
Drupal 6.20
does the patch in #18 work for Drupal 6.20 ?
Comment #48
dozymoe CreditAttribution: dozymoe commented@47 I think the problem lies with the server (linux system??) not correctly setup to support UNICODE or UTF-8, please see 2 (two) comments before you.
I run to this problem while helping in #drupal-support IRC channel.
If you are curious whether your system support UTF-8, you could try these commands on console (probably via ssh).
Get the list of available locale.
locale -a
Positive result if you see a line with the word "utf8". If not you need to generate UTF-8 locale, see your server documentation on how to (hint: probably via locale-gen).
Are we using the correct locale (UTF-8)?
locale
Positive result if LC_CTYPE value is set to "UTF-8", otherwise, again, see your server documentation.
fireh.
Comment #49
TechNikh CreditAttribution: TechNikh commented@#48 This is what I see on locale
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
Comment #50
dozymoe CreditAttribution: dozymoe commentedI put this link about PHP's regexp escape sequences for future reference, because it is damn hard to google for something like "preg_match \x". >:(
Also this specific comment that I'm not sure if it means anything. :(
Okay, one more time for the record. What's the output of this:
pcretest -C
Comment #51
TechNikh CreditAttribution: TechNikh commented@dozymoe
$ pcretest -C
PCRE version 4.5 01-December-2003
Compiled with
UTF-8 support
Newline character is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Match recursion uses stack
FYI This error doesn't show up in my staging server which is drupal 6.22 and also with PCRE version 8.12 2011-01-15
Comment #52
dozymoe CreditAttribution: dozymoe commentedNow, we could scratch server support of UTF-8 out of the equation.
Being clueless as it is, I can only offer these steps:
Upgrade pcre.
Since this is what php use to perform preg_match, imho.
Try available options at comment #18 and #3, from heine.
Keep a note for when doing upgrades.
In that order of necessity. I think. Maybe other would chime in on this.
Comment #53
beakalteshome CreditAttribution: beakalteshome commentedComment #55
roelie CreditAttribution: roelie commentedIn drupal7 (fresh install), had the same problem.
#3 (http://drupal.org/node/820366#comment-3069886) got rid of the error for me.