1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Update XSS Security

This commit is contained in:
Daniel Neto 2024-05-03 12:25:11 -03:00
parent 47a4532d0b
commit 3457115626
3 changed files with 9 additions and 15 deletions

View file

@ -136,6 +136,10 @@ function fakeBrowser($url)
return $output;
}
function getUserAgentInfo(){
return get_browser_name() . '/' . getOS(). ' ('.(isMobile() ? "Mobile" : "PC").')';
}
function get_browser_name($user_agent = "")
{
if (empty($user_agent)) {

View file

@ -37,8 +37,6 @@ class logincontrol_history extends ObjectYPT
foreach ($fullData as $row) {
$rows[] = $row;
}
} else {
_error_log($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
return $rows;
}
@ -134,16 +132,13 @@ class logincontrol_history extends ObjectYPT
$row['type'] = ($row['status']!==logincontrol_history_status::$CONFIRMED) ? __("Failed login attempt") : __("Successfully logged in");
$rows[] = $row;
}
} else {
_error_log($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
return $rows;
}
public static function getDeviceName($user_agent)
{
$device = get_browser_name($user_agent);
$device .= " - " . getOS($user_agent);
$device = getUserAgentInfo();
return $device;
}

View file

@ -18,7 +18,7 @@ $page = new Page('About', 'about');
$custom = $ec->getAbout();
}
if (empty($custom)) {
?>
?>
<h1><?php echo __("I would humbly like to thank God for giving me the necessary knowledge, motivation, resources and idea to be able to execute this project. Without God's permission this would never be possible."); ?></h1>
<blockquote class="blockquote">
<h1><?php echo __("For of Him, and through Him, and to Him, are all things: to whom be glory for ever. Amen."); ?></h1>
@ -35,14 +35,9 @@ $page = new Page('About', 'about');
</span>
<div class="clearfix"></div>
<span class="label label-info">
<?php echo __("You are using"); ?>: <?php echo get_browser_name() . " " . __("on") . " " . getOS(); ?> (<?php echo isMobile() ? __("Mobile") : __("PC"); ?>)
<?php echo __("You are using"); ?>: <?php echo getUserAgentInfo(); ?> (<?php echo isMobile() ? __("Mobile") : __("PC"); ?>)
</span>
<span class="label label-default">
<?php echo $_SERVER['HTTP_USER_AGENT']; ?>
</span>
<?php
<?php
} else {
echo $custom;
}