mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Replaces lentext with length
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
// Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts.
|
||||
/proc/sanitizeSQL(var/t as text)
|
||||
var/sqltext = dbcon.Quote(t);
|
||||
return copytext(sqltext, 2, lentext(sqltext));//Quote() adds quotes around input, we already do that
|
||||
return copytext(sqltext, 2, length(sqltext));//Quote() adds quotes around input, we already do that
|
||||
|
||||
/*
|
||||
* Text sanitization
|
||||
@@ -249,9 +249,9 @@
|
||||
//This is used for fingerprints
|
||||
/proc/stringmerge(var/text,var/compare,replace = "*")
|
||||
var/newtext = text
|
||||
if(lentext(text) != lentext(compare))
|
||||
if(length(text) != length(compare))
|
||||
return 0
|
||||
for(var/i = 1, i < lentext(text), i++)
|
||||
for(var/i = 1, i < length(text), i++)
|
||||
var/a = copytext(text,i,i+1)
|
||||
var/b = copytext(compare,i,i+1)
|
||||
//if it isn't both the same letter, or if they are both the replacement character
|
||||
@@ -271,7 +271,7 @@
|
||||
if(!text || !character)
|
||||
return 0
|
||||
var/count = 0
|
||||
for(var/i = 1, i <= lentext(text), i++)
|
||||
for(var/i = 1, i <= length(text), i++)
|
||||
var/a = copytext(text,i,i+1)
|
||||
if(a == character)
|
||||
count++
|
||||
@@ -286,8 +286,8 @@
|
||||
//Used in preferences' SetFlavorText and human's set_flavor verb
|
||||
//Previews a string of len or less length
|
||||
proc/TextPreview(var/string,var/len=40)
|
||||
if(lentext(string) <= len)
|
||||
if(!lentext(string))
|
||||
if(length(string) <= len)
|
||||
if(!length(string))
|
||||
return "\[...\]"
|
||||
else
|
||||
return string
|
||||
|
||||
Reference in New Issue
Block a user