Print Page | Close Window

Windows Authentication:Users with apostrophes

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=27447
Printed Date: 02 April 2026 at 5:43pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Windows Authentication:Users with apostrophes
Posted By: keithBromley
Subject: Windows Authentication:Users with apostrophes
Date Posted: 09 June 2009 at 2:29pm
A very minor thing, but some of our domain users have apostrophes in their names and even in their email addresses.
Auto-registration fails for these users in functions\functions_windows_authentication.asp, windowsAuthentication()_get_check_username
 
easily solved with another replace()...
 
Keith



Replies:
Posted By: keithBromley
Date Posted: 09 June 2009 at 2:31pm
I should have said... This is in MS SQL Server version of web wiz forums v9.56
Keith


Posted By: WebWiz-Bruce
Date Posted: 09 June 2009 at 2:38pm
Changing line 161 to the following should fix the issue:-

"WHERE " & strDbTable & "Author.Username = '" & formatSQLInput(strUserName) & "';"


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: keithBromley
Date Posted: 09 June 2009 at 2:50pm
I used:
 
"WHERE " & strDbTable & "Author.Username = '" & Replace(strUserName, "'", "''") & "';"
 
but your suggestion is better, thank you!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net