forked from rDrama/rDrama
unify email regex
parent
d91827028b
commit
9efc0f0a68
|
@ -1239,3 +1239,5 @@ forced_hats = {
|
||||||
"is_suspended": ("Behind Bars", "This user is banned and needs to do better!"),
|
"is_suspended": ("Behind Bars", "This user is banned and needs to do better!"),
|
||||||
"agendaposter": ("Egg_irl", "This user is getting in touch with xir identity!")
|
"agendaposter": ("Egg_irl", "This user is getting in touch with xir identity!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EMAIL_REGEX_PATTERN = '[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{2,63}\.[A-Za-z]{2,63}'
|
||||||
|
|
|
@ -48,5 +48,6 @@ def inject_constants():
|
||||||
"KOFI_TOKEN":KOFI_TOKEN, "KOFI_LINK":KOFI_LINK,
|
"KOFI_TOKEN":KOFI_TOKEN, "KOFI_LINK":KOFI_LINK,
|
||||||
"approved_embed_hosts":approved_embed_hosts,
|
"approved_embed_hosts":approved_embed_hosts,
|
||||||
"site_settings":app.config['SETTINGS'],
|
"site_settings":app.config['SETTINGS'],
|
||||||
"EMAIL":EMAIL, "calc_users": calc_users, "TELEGRAM_LINK": TELEGRAM_LINK
|
"EMAIL":EMAIL, "calc_users":calc_users, "TELEGRAM_LINK":TELEGRAM_LINK,
|
||||||
|
"EMAIL_REGEX_PATTERN":EMAIL_REGEX_PATTERN,
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ emoji_regex3 = re.compile(f'(?<!"):([!@{valid_username_chars}]{{1,35}}?):', flag
|
||||||
snappy_url_regex = re.compile('<a href="(https?:\/\/.+?)".*?>(.+?)<\/a>', flags=re.A)
|
snappy_url_regex = re.compile('<a href="(https?:\/\/.+?)".*?>(.+?)<\/a>', flags=re.A)
|
||||||
snappy_youtube_regex = re.compile('<lite-youtube videoid="(.+?)" params="autoplay=1', flags=re.A)
|
snappy_youtube_regex = re.compile('<lite-youtube videoid="(.+?)" params="autoplay=1', flags=re.A)
|
||||||
|
|
||||||
email_regex = re.compile('[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}', flags=re.A|re.I)
|
email_regex = re.compile(EMAIL_REGEX_PATTERN, flags=re.A)
|
||||||
|
|
||||||
utm_regex = re.compile('utm_[0-z]+=[0-z_]+&', flags=re.A)
|
utm_regex = re.compile('utm_[0-z]+=[0-z_]+&', flags=re.A)
|
||||||
utm_regex2 = re.compile('[?&]utm_[0-z]+=[0-z_]+', flags=re.A)
|
utm_regex2 = re.compile('[?&]utm_[0-z]+=[0-z_]+', flags=re.A)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<label for="email" class="mt-3">Email</label>
|
<label for="email" class="mt-3">Email</label>
|
||||||
|
|
||||||
<input type="email" pattern='([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+' autocomplete="off" class="form-control" id="password" aria-describedby="passwordHelp" name="email" required>
|
<input type="email" pattern='{{EMAIL_REGEX_PATTERN}}' autocomplete="off" class="form-control" id="password" aria-describedby="passwordHelp" name="email" required>
|
||||||
|
|
||||||
<input autocomplete="off" class="btn btn-primary login w-100 mt-3" type="submit" onclick="disable(this)" value="Send recovery link">
|
<input autocomplete="off" class="btn btn-primary login w-100 mt-3" type="submit" onclick="disable(this)" value="Send recovery link">
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
<label for="email" class="mt-3">Email</label>
|
<label for="email" class="mt-3">Email</label>
|
||||||
|
|
||||||
<input autocomplete="off" class="form-control" id="password" type="email" pattern='([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+' name="email" required=""{% if v %} value="{{v.email}}" disabled{% endif %}>
|
<input autocomplete="off" class="form-control" id="password" type="email" pattern='{{EMAIL_REGEX_PATTERN}}' name="email" required=""{% if v %} value="{{v.email}}" disabled{% endif %}>
|
||||||
|
|
||||||
<input autocomplete="off" class="btn btn-primary login w-100 mt-3" type="submit" onclick="disable(this)" value="Send recovery link">
|
<input autocomplete="off" class="btn btn-primary login w-100 mt-3" type="submit" onclick="disable(this)" value="Send recovery link">
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<label for="new-email" class="w-lg-25">Email</label>
|
<label for="new-email" class="w-lg-25">Email</label>
|
||||||
<div class="w-lg-100">
|
<div class="w-lg-100">
|
||||||
<input autocomplete="off" class="form-control" id="new_email" {% if v.email %}placeholder="{{v.email}}"{% else %}placeholder="Your email"{% endif %}
|
<input autocomplete="off" class="form-control" id="new_email" {% if v.email %}placeholder="{{v.email}}"{% else %}placeholder="Your email"{% endif %}
|
||||||
aria-describedby="new_email" type="email" pattern='([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+' name="new_email" required>
|
aria-describedby="new_email" type="email" pattern='{{EMAIL_REGEX_PATTERN}}' name="new_email" required>
|
||||||
{% if v.email and not v.is_activated %}
|
{% if v.email and not v.is_activated %}
|
||||||
<div class="text-danger text-small mt-1" id="email-verify-text">Email not verified. You will not be able to recover your account with this email until you verify it. <u><a role="button" onclick="post_toast(this,'/verify_email');emailVerifyText()"class="text-danger">Verify now.</a></u></div>
|
<div class="text-danger text-small mt-1" id="email-verify-text">Email not verified. You will not be able to recover your account with this email until you verify it. <u><a role="button" onclick="post_toast(this,'/verify_email');emailVerifyText()"class="text-danger">Verify now.</a></u></div>
|
||||||
{% elif not v.email %}
|
{% elif not v.email %}
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
<small class="d-inline-block text-muted ml-1">(optional)</small>
|
<small class="d-inline-block text-muted ml-1">(optional)</small>
|
||||||
|
|
||||||
<input style="background-color: var(--gray-800)" autocomplete="off" class="form-control" id="email-register"
|
<input style="background-color: var(--gray-800)" autocomplete="off" class="form-control" id="email-register"
|
||||||
aria-describedby="emailHelpRegister" type="email" pattern='([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+' name="email" readonly onfocus="if (this.hasAttribute('readonly')) {this.removeAttribute('readonly');this.blur();this.focus()}">
|
aria-describedby="emailHelpRegister" type="email" pattern='{{EMAIL_REGEX_PATTERN}}' name="email" readonly onfocus="if (this.hasAttribute('readonly')) {this.removeAttribute('readonly');this.blur();this.focus()}">
|
||||||
|
|
||||||
<label for="password-register" class="mt-3">Password</label>
|
<label for="password-register" class="mt-3">Password</label>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue