view util/mathcompat.lua @ 14120:0e9e3efa381f 13.0

mod_admin_shell: Fail user creation/modification if new password fails saslprep This saves us from setting an invalid password and preventing the new account from authenticating.
author Matthew Wild <mwild1@gmail.com>
date Thu, 02 Apr 2026 20:53:04 +0100
parents 8815d3090928
children
line wrap: on
line source

if not math.type then

	local function math_type(t)
		if type(t) == "number" then
			if t % 1 == 0 and t ~= t + 1 and t ~= t - 1 then
				return "integer"
			else
				return "float"
			end
		end
	end
	_G.math.type = math_type
end