Use boolean setting as true boolean (#7284)
* use boolean setting as true boolean * Update settings class to use the php filter_var function for boolean Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested. I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here. * Update settings class to use the php filter_var function for boolean Using the built-in filter type for boolean seems like a better option as they are faster, already hardened, and more widely tested. I found this better method used originally by Mark J. Crane in 2022 in the content.php page so I included it here.
This commit is contained in:
@@ -341,7 +341,7 @@
|
||||
*/
|
||||
|
||||
//send feature event notify to the phone
|
||||
if (!empty($_SESSION['device']['feature_sync']['boolean']) && $_SESSION['device']['feature_sync']['boolean'] == "true") {
|
||||
if (filter_var($_SESSION['device']['feature_sync']['boolean'] ?? false, FILTER_VALIDATE_BOOL)) {
|
||||
$ring_count = ceil($call_timeout / 6);
|
||||
$feature_event_notify = new feature_event_notify;
|
||||
$feature_event_notify->domain_name = $_SESSION['domain_name'];
|
||||
@@ -358,7 +358,7 @@
|
||||
else {
|
||||
$feature_event_notify->forward_all_destination = $forward_all_destination;
|
||||
}
|
||||
|
||||
|
||||
if ($forward_busy_destination == "") {
|
||||
$feature_event_notify->forward_busy_destination = "0";
|
||||
}
|
||||
@@ -504,7 +504,7 @@
|
||||
}
|
||||
|
||||
//prepare the autocomplete
|
||||
if(!empty($_SESSION['follow_me']['follow_me_autocomplete']['boolean']) && $_SESSION['follow_me']['follow_me_autocomplete']['boolean'] == 'true') {
|
||||
if(filter_var($_SESSION['follow_me']['follow_me_autocomplete']['boolean'] ?? false, FILTER_VALIDATE_BOOLEAN)) {
|
||||
echo "<link rel=\"stylesheet\" href=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.css\" />\n";
|
||||
echo "<script src=\"".PROJECT_PATH."/resources/jquery/jquery-ui.min.js\"></script>\n";
|
||||
echo "<script type=\"text/javascript\">\n";
|
||||
|
||||
Reference in New Issue
Block a user