Skip to content

Commit

Permalink
Replace the remaining php files with nullable_htmlentites()
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyq committed May 11, 2023
1 parent ccf0d3a commit 37fb696
Show file tree
Hide file tree
Showing 152 changed files with 1,086 additions and 1,086 deletions.
2 changes: 1 addition & 1 deletion api_key_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
$sql = mysqli_query($mysqli, "SELECT * FROM clients ORDER BY client_name ASC");
while ($row = mysqli_fetch_array($sql)) {
$client_id = intval($row['client_id']);
$client_name = htmlentities($row['client_name']); ?>
$client_name = nullable_htmlentities($row['client_name']); ?>
<option value="<?php echo $client_id; ?>"><?php echo "$client_name (Client ID: $client_id)"; ?></option>
<?php } ?>
</select>
Expand Down
8 changes: 4 additions & 4 deletions calendar_event_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
$sql = mysqli_query($mysqli, "SELECT * FROM calendars ORDER BY calendar_name ASC");
while ($row = mysqli_fetch_array($sql)) {
$calendar_id = intval($row['calendar_id']);
$calendar_name = htmlentities($row['calendar_name']);
$calendar_color = htmlentities($row['calendar_color']);
$calendar_name = nullable_htmlentities($row['calendar_name']);
$calendar_color = nullable_htmlentities($row['calendar_color']);
?>
<option <?php if ($config_default_calendar == $calendar_id) { echo "selected"; } ?> data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color; ?>;'></i> <?php echo $calendar_name; ?>" value="<?php echo $calendar_id; ?>"><?php echo $calendar_name; ?></option>
<?php } ?>
Expand Down Expand Up @@ -120,8 +120,8 @@
$sql = mysqli_query($mysqli, "SELECT * FROM clients LEFT JOIN contacts ON primary_contact = contact_id ORDER BY client_name ASC");
while ($row = mysqli_fetch_array($sql)) {
$client_id = intval($row['client_id']);
$client_name = htmlentities($row['client_name']);
$contact_email = htmlentities($row['contact_email']);
$client_name = nullable_htmlentities($row['client_name']);
$contact_email = nullable_htmlentities($row['contact_email']);
?>
<option value="<?php echo $client_id; ?>"><?php echo $client_name; ?></option>

Expand Down
8 changes: 4 additions & 4 deletions calendar_event_edit_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
$sql_calendars_select = mysqli_query($mysqli, "SELECT * FROM calendars ORDER BY calendar_name ASC");
while ($row = mysqli_fetch_array($sql_calendars_select)) {
$calendar_id_select = intval($row['calendar_id']);
$calendar_name_select = htmlentities($row['calendar_name']);
$calendar_color_select = htmlentities($row['calendar_color']);
$calendar_name_select = nullable_htmlentities($row['calendar_name']);
$calendar_color_select = nullable_htmlentities($row['calendar_color']);
?>
<option data-content="<i class='fa fa-circle mr-2' style='color:<?php echo $calendar_color_select; ?>;'></i> <?php echo $calendar_name_select; ?>"<?php if ($calendar_id == $calendar_id_select) { echo "selected"; } ?> value="<?php echo $calendar_id_select; ?>"><?php echo $calendar_name_select; ?></option>

Expand Down Expand Up @@ -119,8 +119,8 @@
$sql_clients = mysqli_query($mysqli, "SELECT * FROM clients LEFT JOIN contacts ON primary_contact = contact_id ORDER BY client_name ASC");
while ($row = mysqli_fetch_array($sql_clients)) {
$client_id_select = intval($row['client_id']);
$client_name_select = htmlentities($row['client_name']);
$contact_email_select = htmlentities($row['contact_email']);
$client_name_select = nullable_htmlentities($row['client_name']);
$contact_email_select = nullable_htmlentities($row['contact_email']);
?>
<option <?php if ($client_id == $client_id_select) { echo "selected"; } ?> value="<?php echo $client_id_select; ?>"><?php echo $client_name_select; ?></option>

Expand Down
14 changes: 7 additions & 7 deletions calendar_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
$sql = mysqli_query($mysqli, "SELECT * FROM events LEFT JOIN calendars ON event_calendar_id = calendar_id");
while ($row = mysqli_fetch_array($sql)) {
$event_id = intval($row['event_id']);
$event_title = htmlentities($row['event_title']);
$event_description = htmlentities($row['event_description']);
$event_start = htmlentities($row['event_start']);
$event_end = htmlentities($row['event_end']);
$event_repeat = htmlentities($row['event_repeat']);
$event_title = nullable_htmlentities($row['event_title']);
$event_description = nullable_htmlentities($row['event_description']);
$event_start = nullable_htmlentities($row['event_start']);
$event_end = nullable_htmlentities($row['event_end']);
$event_repeat = nullable_htmlentities($row['event_repeat']);
$calendar_id = intval($row['calendar_id']);
$calendar_name = htmlentities($row['calendar_name']);
$calendar_color = htmlentities($row['calendar_color']);
$calendar_name = nullable_htmlentities($row['calendar_name']);
$calendar_color = nullable_htmlentities($row['calendar_color']);
$client_id = intval($row['event_client_id']);

require("calendar_event_edit_modal.php");
Expand Down
10 changes: 5 additions & 5 deletions categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@

<div class="card card-dark">
<div class="card-header py-2">
<h3 class="card-title mt-2"><i class="fa fa-fw fa-list mr-2"></i><?php echo htmlentities($category); ?> Categories</h3>
<h3 class="card-title mt-2"><i class="fa fa-fw fa-list mr-2"></i><?php echo nullable_htmlentities($category); ?> Categories</h3>
<div class="card-tools">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addCategoryModal"><i class="fas fa-plus mr-2"></i>New</button>
</div>
</div>
<div class="card-body">
<form autocomplete="off">
<input type="hidden" name="category" value="<?php echo htmlentities($category); ?>">
<input type="hidden" name="category" value="<?php echo nullable_htmlentities($category); ?>">
<div class="row">
<div class="col-sm-4 mb-2">
<div class="input-group">
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(htmlentities($q)); } ?>" placeholder="Search Categories">
<input type="search" class="form-control" name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search Categories">
<div class="input-group-append">
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
Expand Down Expand Up @@ -88,8 +88,8 @@

while ($row = mysqli_fetch_array($sql)) {
$category_id = intval($row['category_id']);
$category_name = htmlentities($row['category_name']);
$category_color = htmlentities($row['category_color']);
$category_name = nullable_htmlentities($row['category_name']);
$category_color = nullable_htmlentities($row['category_color']);
//$colors_used_array[] = $row['category_color'];

?>
Expand Down
4 changes: 2 additions & 2 deletions category_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<div class="modal-dialog">
<div class="modal-content bg-dark">
<div class="modal-header">
<h5 class="modal-title"><i class="fa fa-fw fa-list mr-2"></i>New <?php echo htmlentities($category); ?> Category</h5>
<h5 class="modal-title"><i class="fa fa-fw fa-list mr-2"></i>New <?php echo nullable_htmlentities($category); ?> Category</h5>
<button type="button" class="close text-white" data-dismiss="modal">
<span>&times;</span>
</button>
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="type" value="<?php echo htmlentities($category); ?>">
<input type="hidden" name="type" value="<?php echo nullable_htmlentities($category); ?>">

<div class="modal-body bg-white">

Expand Down
2 changes: 1 addition & 1 deletion category_edit_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="category_id" value="<?php echo $category_id; ?>">
<input type="hidden" name="type" value="<?php echo htmlentities($category); ?>">
<input type="hidden" name="type" value="<?php echo nullable_htmlentities($category); ?>">
<div class="modal-body bg-white">

<div class="form-group">
Expand Down
8 changes: 4 additions & 4 deletions client_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

$referral_sql = mysqli_query($mysqli, "SELECT * FROM categories WHERE category_type = 'Referral' AND category_archived_at IS NULL ORDER BY category_name ASC");
while ($row = mysqli_fetch_array($referral_sql)) {
$referral = htmlentities($row['category_name']); ?>
$referral = nullable_htmlentities($row['category_name']); ?>
<option><?php echo $referral; ?></option>
<?php } ?>

Expand Down Expand Up @@ -296,9 +296,9 @@

while ($row = mysqli_fetch_array($sql_tags_select)) {
$tag_id_select = intval($row['tag_id']);
$tag_name_select = htmlentities($row['tag_name']);
$tag_color_select = htmlentities($row['tag_color']);
$tag_icon_select = htmlentities($row['tag_icon']);
$tag_name_select = nullable_htmlentities($row['tag_name']);
$tag_color_select = nullable_htmlentities($row['tag_color']);
$tag_icon_select = nullable_htmlentities($row['tag_icon']);

?>
<li class="list-group-item">
Expand Down
10 changes: 5 additions & 5 deletions client_asset_add_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
$sql = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_archived_at IS NULL AND location_client_id = $client_id ORDER BY location_name ASC");
while ($row = mysqli_fetch_array($sql)) {
$location_id = intval($row['location_id']);
$location_name = htmlentities($row['location_name']);
$location_name = nullable_htmlentities($row['location_name']);
?>
<option value="<?php echo $location_id; ?>"><?php echo $location_name; ?></option>
<?php } ?>
Expand All @@ -148,7 +148,7 @@
$sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
while ($row = mysqli_fetch_array($sql)) {
$contact_id = intval($row['contact_id']);
$contact_name = htmlentities($row['contact_name']);
$contact_name = nullable_htmlentities($row['contact_name']);
?>
<option value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>

Expand Down Expand Up @@ -187,8 +187,8 @@
$sql = mysqli_query($mysqli, "SELECT * FROM networks WHERE network_archived_at IS NULL AND network_client_id = $client_id ORDER BY network_name ASC");
while ($row = mysqli_fetch_array($sql)) {
$network_id = intval($row['network_id']);
$network_name = htmlentities($row['network_name']);
$network = htmlentities($row['network']);
$network_name = nullable_htmlentities($row['network_name']);
$network = nullable_htmlentities($row['network']);

?>
<option value="<?php echo $network_id; ?>"><?php echo $network_name; ?> - <?php echo $network; ?></option>
Expand Down Expand Up @@ -235,7 +235,7 @@
$sql = mysqli_query($mysqli, "SELECT * FROM vendors WHERE vendor_archived_at IS NULL AND vendor_client_id = $client_id AND vendor_template = 0 ORDER BY vendor_name ASC");
while ($row = mysqli_fetch_array($sql)) {
$vendor_id = intval($row['vendor_id']);
$vendor_name = htmlentities($row['vendor_name']);
$vendor_name = nullable_htmlentities($row['vendor_name']);
?>
<option value="<?php echo $vendor_id; ?>"><?php echo $vendor_name; ?></option>

Expand Down
10 changes: 5 additions & 5 deletions client_asset_copy_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
$sql_locations = mysqli_query($mysqli, "SELECT * FROM locations WHERE location_client_id = $client_id ORDER BY location_name ASC");
while ($row = mysqli_fetch_array($sql_locations)) {
$location_id_select = intval($row['location_id']);
$location_name_select = htmlentities($row['location_name']);
$location_name_select = nullable_htmlentities($row['location_name']);
?>
<option <?php if ($asset_location_id == $location_id_select) { echo "selected"; } ?> value="<?php echo $location_id_select; ?>"><?php echo $location_name_select; ?></option>
<?php } ?>
Expand All @@ -145,7 +145,7 @@
$sql_contacts = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_archived_at IS NULL AND contact_client_id = $client_id ORDER BY contact_name ASC");
while ($row = mysqli_fetch_array($sql_contacts)) {
$contact_id = intval($row['contact_id']);
$contact_name = htmlentities($row['contact_name']);
$contact_name = nullable_htmlentities($row['contact_name']);
?>
<option value="<?php echo $contact_id; ?>"><?php echo $contact_name; ?></option>
<?php } ?>
Expand Down Expand Up @@ -182,8 +182,8 @@
$sql_networks = mysqli_query($mysqli, "SELECT * FROM networks WHERE (network_archived_at > '$asset_created_at' OR network_archived_at IS NULL) AND network_client_id = $client_id ORDER BY network_name ASC");
while ($row = mysqli_fetch_array($sql_networks)) {
$network_id_select = intval($row['network_id']);
$network_name_select = htmlentities($row['network_name']);
$network_select = htmlentities($row['network']);
$network_name_select = nullable_htmlentities($row['network_name']);
$network_select = nullable_htmlentities($row['network']);

?>
<option <?php if ($asset_network_id == $network_id_select) { echo "selected"; } ?> value="<?php echo $network_id_select; ?>"><?php echo $network_name_select; ?> - <?php echo $network_select; ?></option>
Expand Down Expand Up @@ -230,7 +230,7 @@
$sql_vendors = mysqli_query($mysqli, "SELECT * FROM vendors WHERE (vendor_archived_at > '$asset_created_at' OR vendor_archived_at IS NULL) AND vendor_client_id = $client_id AND vendor_template = 0 ORDER BY vendor_name ASC");
while ($row = mysqli_fetch_array($sql_vendors)) {
$vendor_id_select = intval($row['vendor_id']);
$vendor_name_select = htmlentities($row['vendor_name']);
$vendor_name_select = nullable_htmlentities($row['vendor_name']);
?>
<option <?php if ($asset_vendor_id == $vendor_id_select) { echo "selected"; } ?> value="<?php echo $vendor_id_select; ?>"><?php echo $vendor_name_select; ?></option>

Expand Down
2 changes: 1 addition & 1 deletion client_asset_documents_modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<?php
while ($row = mysqli_fetch_array($sql_related_documents)) {
$related_document_id = intval($row['document_id']);
$related_document_name = htmlentities($row['document_name']);
$related_document_name = nullable_htmlentities($row['document_name']);
?>
<p>
<i class="fas fa-fw fa-document text-secondary"></i>
Expand Down
Loading

0 comments on commit 37fb696

Please sign in to comment.