vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   RegEx Case Sensitivity (https://vborg.vbsupport.ru/showthread.php?t=282132)

ItsDrew 04-27-2012 09:02 PM

RegEx Case Sensitivity
 
Version 4.1.10
Options > User Registration Options > Username Regular Expression

^[A-Z][A-Za-z]+\.[A-Z][A-Za-z-]+$

I'm trying to force Firstname.Lastname or Firstname-Lastname-Lastname with the first letter being forced to a capital letter. But it seems as if the code autimacially puts the lower case i at the end of the preg_match string to ignore case.

How can I remove the "i" from the preg_match code so I can force case sensitivity?

kh99 04-28-2012 10:50 AM

In includes/class_dm.php, function verify_username() around line 456 is this:

Code:

// check for regex compliance
if (!preg_match('#' . str_replace('#', '\#', $this->registry->options['usernameregex']) . '#siU', $username))
{


I think that's where you'd want to remove it. Another approach might be to use a plugin on the registration page to change the username that's entered, or even build it from first name/last name fields.

ItsDrew 04-30-2012 03:23 PM

Quote:

Originally Posted by kh99 (Post 2324259)
In includes/class_dm.php, function verify_username() around line 456 is this:

Code:

// check for regex compliance
if (!preg_match('#' . str_replace('#', '\#', $this->registry->options['usernameregex']) . '#siU', $username))
{


I think that's where you'd want to remove it. Another approach might be to use a plugin on the registration page to change the username that's entered, or even build it from first name/last name fields.

That worked perfectly. I just removed the 'i' from the '#siU'

Note: The file name was includes/class_dm_user.php

Thanks for your help!

kh99 04-30-2012 03:32 PM

Quote:

Originally Posted by ItsDrew (Post 2324910)
Note: The file name was includes/class_dm_user.php


Oops...sorry about that. It's actually in both of those files, but I don't know when the one in class_dm.php would be used.


All times are GMT. The time now is 04:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00938 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete