Replaces lentext with length

This commit is contained in:
Unknown
2019-12-12 13:13:18 -05:00
parent 6dd6940332
commit f68a82b81f
23 changed files with 59 additions and 59 deletions

View File

@@ -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