Skip to content

Commit 3c56156

Browse files
xLuxyqaisjp
authored andcommitted
admin2: Fix stripColorCodes exploit and make shared
See fb9862a
1 parent 7917f76 commit 3c56156

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

[admin]/admin2/client/admin_wrapper.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,3 @@ function getPlayerFromNick(nick)
8484
end
8585
return false
8686
end
87-
88-
function stripColorCodes(text)
89-
return string.gsub(text, "#%x%x%x%x%x%x", "")
90-
end

[admin]/admin2/meta.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
<script src="client/widgets/admin_report.lua" type="client" />
7979
<script src="client/widgets/admin_weapon.lua" type="client" />
8080

81+
<script src="shared/utils.lua" type="shared" />
82+
8183
<html src="http/screenshots.htm" />
8284
<html src="http/screenshot.htm" />
8385

[admin]/admin2/shared/utils.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--[[**********************************
2+
*
3+
* Multi Theft Auto - Admin Panel
4+
*
5+
* client/admin_coroutines.lua
6+
*
7+
* Original File by lil_Toady
8+
*
9+
**************************************]]
10+
11+
function stripColorCodes(str)
12+
local oldLen
13+
repeat
14+
oldLen = str:len()
15+
str = str:gsub('#%x%x%x%x%x%x', '')
16+
until str:len() == oldLen
17+
return str
18+
end

0 commit comments

Comments
 (0)