mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Encode changes (#11301)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5e6a4639d0
commit
4e2361f8df
@@ -34,7 +34,7 @@
|
||||
O.loc = src
|
||||
update_icon()
|
||||
else if(istype(O, /obj/item/pen))
|
||||
var/newname = sanitizeSafe(tgui_input_text(user, "What would you like to title this bookshelf?", null, null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
var/newname = sanitizeSafe(tgui_input_text(user, "What would you like to title this bookshelf?", null, null, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN)
|
||||
if(!newname)
|
||||
return
|
||||
else
|
||||
@@ -232,7 +232,7 @@ Book Cart End
|
||||
var/choice = tgui_input_list(user, "What would you like to change?", "Change What?", list("Title", "Contents", "Author", "Cancel"))
|
||||
switch(choice)
|
||||
if("Title")
|
||||
var/newtitle = reject_bad_text(sanitizeSafe(tgui_input_text(user, "Write a new title:")))
|
||||
var/newtitle = reject_bad_text(sanitizeSafe(tgui_input_text(user, "Write a new title:", encode = FALSE)))
|
||||
if(!newtitle)
|
||||
to_chat(user, "The title is invalid.")
|
||||
return
|
||||
@@ -240,14 +240,14 @@ Book Cart End
|
||||
src.name = newtitle
|
||||
src.title = newtitle
|
||||
if("Contents")
|
||||
var/content = sanitize(tgui_input_text(user, "Write your book's contents (HTML NOT allowed):", max_length=MAX_BOOK_MESSAGE_LEN, multiline=TRUE), MAX_BOOK_MESSAGE_LEN)
|
||||
var/content = tgui_input_text(user, "Write your book's contents (HTML NOT allowed):", max_length=MAX_BOOK_MESSAGE_LEN, multiline=TRUE)
|
||||
if(!content)
|
||||
to_chat(user, "The content is invalid.")
|
||||
return
|
||||
else
|
||||
src.dat += content
|
||||
if("Author")
|
||||
var/newauthor = sanitize(tgui_input_text(user, "Write the author's name:"))
|
||||
var/newauthor = tgui_input_text(user, "Write the author's name:", "", "", MAX_LNAME_LEN)
|
||||
if(!newauthor)
|
||||
to_chat(user, "The name is invalid.")
|
||||
return
|
||||
|
||||
@@ -74,26 +74,16 @@
|
||||
return
|
||||
|
||||
if(href_list["settitle"])
|
||||
var/newtitle = tgui_input_text(usr, "Enter a title to search for:")
|
||||
if(newtitle)
|
||||
title = sanitize(newtitle)
|
||||
else
|
||||
title = null
|
||||
title = sanitizeSQL(title)
|
||||
var/newtitle = tgui_input_text(usr, "Enter a title to search for:", max_length = MAX_MESSAGE_LEN)
|
||||
title = sanitizeSQL(newtitle)
|
||||
if(href_list["setcategory"])
|
||||
var/newcategory = tgui_input_list(usr, "Choose a category to search for:", "Category", list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion"))
|
||||
if(newcategory)
|
||||
category = sanitize(newcategory)
|
||||
else
|
||||
if(!newcategory)
|
||||
category = "Any"
|
||||
category = sanitizeSQL(category)
|
||||
if(href_list["setauthor"])
|
||||
var/newauthor = tgui_input_text(usr, "Enter an author to search for:")
|
||||
if(newauthor)
|
||||
author = sanitize(newauthor)
|
||||
else
|
||||
author = null
|
||||
author = sanitizeSQL(author)
|
||||
var/newauthor = tgui_input_text(usr, "Enter an author to search for:", max_length = MAX_MESSAGE_LEN)
|
||||
author = sanitizeSQL(newauthor)
|
||||
if(href_list["search"])
|
||||
SQLquery = "SELECT author, title, category, id FROM library WHERE "
|
||||
if(category == "Any")
|
||||
@@ -400,9 +390,9 @@
|
||||
if(checkoutperiod < 1)
|
||||
checkoutperiod = 1
|
||||
if(href_list["editbook"])
|
||||
buffer_book = sanitizeSafe(tgui_input_text(usr, "Enter the book's title:"))
|
||||
buffer_book = sanitizeSafe(tgui_input_text(usr, "Enter the book's title:", encode = FALSE))
|
||||
if(href_list["editmob"])
|
||||
buffer_mob = sanitize(tgui_input_text(usr, "Enter the recipient's name:", null, null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
buffer_mob = tgui_input_text(usr, "Enter the recipient's name:", null, null, MAX_NAME_LEN)
|
||||
if(href_list["checkout"])
|
||||
var/datum/borrowbook/b = new /datum/borrowbook
|
||||
b.bookname = sanitizeSafe(buffer_book)
|
||||
@@ -417,7 +407,7 @@
|
||||
var/obj/item/book/b = locate(href_list["delbook"])
|
||||
inventory.Remove(b)
|
||||
if(href_list["setauthor"])
|
||||
var/newauthor = sanitize(tgui_input_text(usr, "Enter the author's name: "))
|
||||
var/newauthor = tgui_input_text(usr, "Enter the author's name: ", "", "", MAX_MESSAGE_LEN)
|
||||
if(newauthor)
|
||||
scanner.cache.author = newauthor
|
||||
if(href_list["setcategory"])
|
||||
|
||||
Reference in New Issue
Block a user