rousnay /
lighthouse
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | // vars |
||
| 4 | $rule_types = apply_filters('acf/location/rule_types', array( |
||
| 5 | __("Post",'acf') => array( |
||
| 6 | 'post_type' => __("Post Type",'acf'), |
||
| 7 | 'post_status' => __("Post Status",'acf'), |
||
| 8 | 'post_format' => __("Post Format",'acf'), |
||
| 9 | 'post_category' => __("Post Category",'acf'), |
||
| 10 | 'post_taxonomy' => __("Post Taxonomy",'acf'), |
||
| 11 | 'post' => __("Post",'acf') |
||
| 12 | ), |
||
| 13 | __("Page",'acf') => array( |
||
| 14 | 'page_template' => __("Page Template",'acf'), |
||
| 15 | 'page_type' => __("Page Type",'acf'), |
||
| 16 | 'page_parent' => __("Page Parent",'acf'), |
||
| 17 | 'page' => __("Page",'acf') |
||
| 18 | ), |
||
| 19 | __("User",'acf') => array( |
||
| 20 | 'current_user' => __("Current User",'acf'), |
||
| 21 | 'current_user_role' => __("Current User Role",'acf'), |
||
| 22 | 'user_form' => __("User Form",'acf'), |
||
| 23 | 'user_role' => __("User Role",'acf') |
||
| 24 | ), |
||
| 25 | __("Forms",'acf') => array( |
||
| 26 | 'attachment' => __("Attachment",'acf'), |
||
| 27 | 'taxonomy' => __("Taxonomy Term",'acf'), |
||
| 28 | 'comment' => __("Comment",'acf'), |
||
| 29 | 'widget' => __("Widget",'acf') |
||
| 30 | ) |
||
| 31 | )); |
||
| 32 | |||
| 33 | $rule_operators = apply_filters( 'acf/location/rule_operators', array( |
||
| 34 | '==' => __("is equal to",'acf'), |
||
| 35 | '!=' => __("is not equal to",'acf'), |
||
| 36 | )); |
||
| 37 | |||
| 38 | ?> |
||
| 39 | <div class="acf-field"> |
||
| 40 | <div class="acf-label"> |
||
| 41 | <label><?php _e("Rules",'acf'); ?></label> |
||
| 42 | <p><?php _e("Create a set of rules to determine which edit screens will use these advanced custom fields",'acf'); ?></p> |
||
| 43 | </div> |
||
| 44 | <div class="acf-input"> |
||
| 45 | <div class="rule-groups"> |
||
| 46 | |||
| 47 | <?php foreach( $field_group['location'] as $group_id => $group ): |
||
| 48 | |||
| 49 | // validate |
||
| 50 | if( empty($group) ) { |
||
| 51 | |||
| 52 | continue; |
||
| 53 | |||
| 54 | } |
||
| 55 | |||
| 56 | |||
| 57 | // $group_id must be completely different to $rule_id to avoid JS issues |
||
| 58 | $group_id = "group_{$group_id}"; |
||
| 59 | $h4 = ($group_id == "group_0") ? __("Show this field group if",'acf') : __("or",'acf'); |
||
| 60 | |||
| 61 | ?> |
||
| 62 | |||
| 63 | <div class="rule-group" data-id="<?php echo $group_id; ?>"> |
||
| 64 | |||
| 65 | <h4><?php echo $h4; ?></h4> |
||
| 66 | |||
| 67 | <table class="acf-table -clear"> |
||
| 68 | <tbody> |
||
| 69 | <?php foreach( $group as $rule_id => $rule ): |
||
| 70 | |||
| 71 | // valid rule |
||
| 72 | $rule = wp_parse_args( $rule, array( |
||
| 73 | 'field' => '', |
||
| 74 | 'operator' => '==', |
||
| 75 | 'value' => '', |
||
| 76 | )); |
||
| 77 | |||
| 78 | |||
| 79 | // $group_id must be completely different to $rule_id to avoid JS issues |
||
| 80 | $rule_id = "rule_{$rule_id}"; |
||
| 81 | |||
| 82 | ?> |
||
| 83 | <tr data-id="<?php echo $rule_id; ?>"> |
||
| 84 | <td class="param"><?php |
||
| 85 | |||
| 86 | // create field |
||
| 87 | acf_render_field(array( |
||
|
0 ignored issues
–
show
|
|||
| 88 | 'type' => 'select', |
||
| 89 | 'prefix' => "acf_field_group[location][{$group_id}][{$rule_id}]", |
||
| 90 | 'name' => 'param', |
||
| 91 | 'value' => $rule['param'], |
||
| 92 | 'choices' => $rule_types, |
||
| 93 | 'class' => 'location-rule-param' |
||
| 94 | )); |
||
| 95 | |||
| 96 | ?></td> |
||
| 97 | <td class="operator"><?php |
||
|
0 ignored issues
–
show
|
|||
| 98 | |||
| 99 | // create field |
||
| 100 | acf_render_field(array( |
||
|
0 ignored issues
–
show
array('type' => 'select'...ocation-rule-operator') is of type array<string,?,{"type":"...:"?","class":"string"}>, but the function expects a boolean.
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
Loading history...
|
|||
| 101 | 'type' => 'select', |
||
| 102 | 'prefix' => "acf_field_group[location][{$group_id}][{$rule_id}]", |
||
| 103 | 'name' => 'operator', |
||
| 104 | 'value' => $rule['operator'], |
||
| 105 | 'choices' => $rule_operators, |
||
| 106 | 'class' => 'location-rule-operator' |
||
| 107 | )); |
||
|
0 ignored issues
–
show
|
|||
| 108 | |||
| 109 | ?></td> |
||
| 110 | <td class="value"><?php |
||
| 111 | |||
| 112 | $this->render_location_value(array( |
||
| 113 | 'group_id' => $group_id, |
||
| 114 | 'rule_id' => $rule_id, |
||
| 115 | 'value' => $rule['value'], |
||
| 116 | 'param' => $rule['param'], |
||
| 117 | 'class' => 'location-rule-value' |
||
| 118 | )); |
||
| 119 | |||
| 120 | ?></td> |
||
| 121 | <td class="add"> |
||
| 122 | <a href="#" class="acf-button add-location-rule"><?php _e("and",'acf'); ?></a> |
||
| 123 | </td> |
||
| 124 | <td class="remove"> |
||
| 125 | <a href="#" class="acf-icon -minus remove-location-rule"></a> |
||
| 126 | </td> |
||
| 127 | </tr> |
||
| 128 | <?php endforeach; ?> |
||
| 129 | </tbody> |
||
| 130 | </table> |
||
| 131 | |||
| 132 | </div> |
||
| 133 | <?php endforeach; ?> |
||
| 134 | |||
| 135 | <h4><?php _e("or",'acf'); ?></h4> |
||
| 136 | |||
| 137 | <a href="#" class="acf-button add-location-group"><?php _e("Add rule group",'acf'); ?></a> |
||
| 138 | |||
| 139 | </div> |
||
| 140 | </div> |
||
| 141 | </div> |
||
| 142 | <script type="text/javascript"> |
||
| 143 | if( typeof acf !== 'undefined' ) { |
||
| 144 | |||
| 145 | acf.postbox.render({ |
||
| 146 | 'id': 'acf-field-group-locations', |
||
| 147 | 'label': 'left' |
||
| 148 | }); |
||
| 149 | |||
| 150 | } |
||
| 151 | </script> |
||
| 152 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: