mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 22:50:07 +01:00
Merge branch 'main' of https://github.com/aftercase/punishedponepaste into main
This commit is contained in:
commit
b2f4dc69d8
2 changed files with 2 additions and 7 deletions
|
@ -63,7 +63,7 @@ function captcha($color, $mode, $mul, $allowed) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overwrite defaults with custom config values
|
// Overwrite defaults with custom config values
|
||||||
if (is_array($config)) {
|
if (!empty($config) && is_array($config)) {
|
||||||
foreach ($config as $key => $value)
|
foreach ($config as $key => $value)
|
||||||
$captcha_config[$key] = $value;
|
$captcha_config[$key] = $value;
|
||||||
}
|
}
|
||||||
|
@ -82,8 +82,6 @@ function captcha($color, $mode, $mul, $allowed) {
|
||||||
if ($captcha_config['max_font_size'] < $captcha_config['min_font_size'])
|
if ($captcha_config['max_font_size'] < $captcha_config['min_font_size'])
|
||||||
$captcha_config['max_font_size'] = $captcha_config['min_font_size'];
|
$captcha_config['max_font_size'] = $captcha_config['min_font_size'];
|
||||||
|
|
||||||
// Use milliseconds instead of seconds
|
|
||||||
srand(microtime() * 100);
|
|
||||||
|
|
||||||
// Generate CAPTCHA code if not set by user
|
// Generate CAPTCHA code if not set by user
|
||||||
if (empty($captcha_config['code'])) {
|
if (empty($captcha_config['code'])) {
|
||||||
|
@ -136,9 +134,6 @@ if (isset($_GET['_CAPTCHA'])) {
|
||||||
if (!$captcha_config)
|
if (!$captcha_config)
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
// Use milliseconds instead of seconds
|
|
||||||
srand(microtime() * 100);
|
|
||||||
|
|
||||||
// Pick random background, get info, and start captcha
|
// Pick random background, get info, and start captcha
|
||||||
$background = $captcha_config['backgrounds'][rand(0, count($captcha_config['backgrounds']) - 1)];
|
$background = $captcha_config['backgrounds'][rand(0, count($captcha_config['backgrounds']) - 1)];
|
||||||
list($bg_width, $bg_height, $bg_type, $bg_attr) = getimagesize($background);
|
list($bg_width, $bg_height, $bg_type, $bg_attr) = getimagesize($background);
|
||||||
|
|
|
@ -142,7 +142,7 @@ if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||||
updatePageViews($conn);
|
updatePageViews($conn);
|
||||||
|
|
||||||
// POST Handler
|
// POST Handler
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
$error = validatePasteFields();
|
$error = validatePasteFields();
|
||||||
|
|
||||||
if ($error !== null) {
|
if ($error !== null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue