Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Pages/Reservation/GuestReservationPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ protected function RouteValidation()
URIScriptValidator::validateOrRedirect($_SERVER['REQUEST_URI'], '/dashboard.php');

if (preg_match('/(?:\?|&)(redirect)=([^&]+)/', $_SERVER['REQUEST_URI'])) {
ParamsValidator::validate(RouteParamsKeys::GUEST_RESERVATION_FROM_CALENDAR, $_SERVER['REQUEST_URI'], '/view-calendar.php', false);
ParamsValidator::validateOrRedirect(RouteParamsKeys::GUEST_RESERVATION_FROM_CALENDAR, $_SERVER['REQUEST_URI'], '/view-calendar.php', false);
} else {
ParamsValidator::validate(RouteParamsKeys::GUEST_RESERVATION_FROM_SCHEDULE, $_SERVER['REQUEST_URI'], '/view-schedule.php', false);
ParamsValidator::validateOrRedirect(RouteParamsKeys::GUEST_RESERVATION_FROM_SCHEDULE, $_SERVER['REQUEST_URI'], '/view-schedule.php', false);
}
}
}
4 changes: 2 additions & 2 deletions Pages/ViewSchedulePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function __construct()
public function ProcessPageLoad()
{

URIScriptValidator::validateOrRedirect($_SERVER['REQUEST_URI'], '/view-schedule.php');
ParamsValidator::validateOrRedirect(RouteParamsKeys::VIEW_SCHEDULE, $_SERVER['REQUEST_URI'], '/view-schedule.php', true);
// URIScriptValidator::validateOrRedirect($_SERVER['REQUEST_URI'], '/view-schedule.php');
// ParamsValidator::validateOrRedirect(RouteParamsKeys::VIEW_SCHEDULE, $_SERVER['REQUEST_URI'], '/view-schedule.php', true);

$user = new NullUserSession();
$this->_presenter->PageLoad($user);
Expand Down
8 changes: 7 additions & 1 deletion lib/Common/Validators/URI/URIScriptValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ public static function validate($requestURI): bool
$isPathSafe = self::isSafePath($path);
$isQuerySafe = self::isSafeQuery($query);

Log::Debug(message: "Validating URI. Path: '$path', Query: '$query', PathSafe: " . ($isPathSafe ? "yes" : "no") . ", QuerySafe: " . ($isQuerySafe ? "yes" : "no"));
Log::Debug(
"Validating URI. Path: %s, Query: %s, PathSafe: %s, QuerySafe: %s",
$path,
$query,
$isPathSafe ? "yes" : "no",
$isQuerySafe ? "yes" : "no"
);

return $isPathSafe && $isQuerySafe;
}
Expand Down
46 changes: 22 additions & 24 deletions tpl/Admin/Resources/manage_resources.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2122,37 +2122,36 @@
$.fn.editabletypes.trumbowyg = Trumbowyg;
}

function hidePopoversWhenClickAway() {
$('body').on('click', function(e) {
$('[rel="popover"]').each(function() {
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e
.target).length === 0) {
$(this).popover('hide');
}
});
});
}

function setUpPopovers() {
$('[rel="popover"]').popover({
container: 'body',
html: true,
placement: 'top',
trigger: 'manual',
content: function() {
var popoverId = $(this).data('popover-content');
return $(popoverId).html();
}
}).click(function(e) {
e.preventDefault();
}).on('show.bs.popover', function() {

}).on('shown.bs.popover', function() {
var trigger = $(this);
var popover = trigger.data('bs.popover').tip();
popover.find('.editable-cancel').click(function() {
trigger.popover('hide');
});
});

$('[rel="popover"]').on('click', function(e) {
e.preventDefault();
e.stopPropagation();

// Hide other popovers if needed
$('[rel="popover"]').not(this).popover('hide');

// Toggle the clicked one
$(this).popover('toggle');
});

$('.descriptionValue').on('shown', function(e, editable) {
$(document).off('click.editable');
});

$('.notesValue').on('shown', function(e, editable) {
$(document).off('click.editable');
});
}

function setupCustomAttributesIcon() {
Expand Down Expand Up @@ -2227,7 +2226,7 @@
});

$('.descriptionValue').editable({
url: updateUrl + '{ManageResourcesActions::ActionChangeDescription}',
url: updateUrl + '{ManageResourcesActions::ActionChangeDescription}',
emptytext: "{translate key='NoDescriptionLabel'|escape:'javascript'}"
});

Expand Down Expand Up @@ -2257,7 +2256,6 @@
$(document).ready(function() {
addTrumbowygType();
setUpPopovers();
hidePopoversWhenClickAway();
setUpEditables();
setupCustomAttributesIcon();

Expand Down Expand Up @@ -2407,4 +2405,4 @@
</script>
</div>

{include file='globalfooter.tpl'}
{include file='globalfooter.tpl'}