Skip to content

Commit

Permalink
Add missing validation rules.Add missing check rule. (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioigoume authored Feb 16, 2024
1 parent d8bec8c commit 3a9f56e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion app/Model/CoDashboardWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,17 @@ class CoDashboardWidget extends AppModel {
'rule' => 'numeric',
'required' => false,
'allowEmpty' => true
)
),
'header' => array(
'rule' => '/.*/',
'required' => false,
'allowEmpty' => true
),
'footer' => array(
'rule' => '/.*/',
'required' => false,
'allowEmpty' => true
),
);

public $_targetid = null;
Expand Down
4 changes: 2 additions & 2 deletions app/View/CoDashboards/dashboard.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@
<?php print filter_var($w['description'], FILTER_SANITIZE_SPECIAL_CHARS); ?>
<span id="widgetSpinner<?php print $w['id']; ?>" class="co-loading-mini"><span></span><span></span><span></span></span>
</h2>
<?php if(!empty(trim($w['header']))): ?>
<?php if(isset($w['header']) && !empty(trim($w['header']))): ?>
<div class="widget-header">
<?php print filter_var($w['header'], FILTER_SANITIZE_SPECIAL_CHARS); ?>
</div>
<?php endif; ?>
<div id="widget<?php print $w['id']; ?>"></div>
<?php if(!empty(trim($w['footer']))): ?>
<?php if(isset($w['footer']) && !empty(trim($w['footer']))): ?>
<div class="widget-footer">
<?php print filter_var($w['footer'], FILTER_SANITIZE_SPECIAL_CHARS); ?>
</div>
Expand Down

0 comments on commit 3a9f56e

Please sign in to comment.