The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MySQL & Symbols?
Author Message
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: MySQL & Symbols?
try using STRREGEX instead STRMATCH
http://wiki.sphere.torfo.org/index.php/C...0#STRREGEX

here you can quick check if your regex code is working properly: https://regex101.com/

Code:
IF (!STRREGEX("\W@.","<ARGTXT[0]>"))
  SYSMESSAGE The ARGTXT[0] have invalid symbols (it's only allowed A-Z words, 0-9 numbers, and @ . symbols)
ENDIF

also it's a good idea use an extra STRMATCH to check if the email format is correct
Code:
IF (!STRMATCH("*@*.*","<ARGTXT[0]>"))
  SYSMESSAGE The ARGTXT[0] is not a valid email format
ENDIF

PS: MySQL is compatible with symbols like \@!'$= etc, but to use them you must escape the data first (add backslash "\" before each symbol) to make the SQL command interpret these values as symbols

eg: to find an char named Test's on SQL table you must add \ before '
Code:
SELECT * FROM chars WHERE name="Test\'s" LIMIT 1

this is a security protection to prevent SQL injection exploits, so to make your SQL database secure, you must always escape the data and never trust user inputs on SQL commands

if you're executing SQL commands using EXECUTE instead AEXECUTE, you can use <DB.ESCAPEDATA <ARGS>> to escape data (this will automatically add \ before each symbol inside <ARGS>)
(This post was last modified: 12-04-2016 03:42 AM by Coruja.)
12-04-2016 03:34 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
MySQL & Symbols? - Llirik - 12-03-2016, 09:47 PM
RE: MySQL & Symbols? - Coruja - 12-04-2016 03:34 AM
RE: MySQL & Symbols? - Llirik - 12-05-2016, 06:09 AM
RE: MySQL & Symbols? - Coruja - 12-05-2016, 10:40 AM
RE: MySQL & Symbols? - Llirik - 12-06-2016, 12:46 AM
RE: MySQL & Symbols? - Llirik - 12-06-2016, 03:02 AM
RE: MySQL & Symbols? - Llirik - 12-06-2016, 07:56 AM
RE: MySQL & Symbols? - Coruja - 12-06-2016, 09:39 AM
RE: MySQL & Symbols? - Llirik - 12-06-2016, 09:47 AM
RE: MySQL & Symbols? - Coruja - 12-06-2016, 10:39 AM
RE: MySQL & Symbols? - Llirik - 12-06-2016, 12:00 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)