PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/models/shortcodes.php +10 -6 1.6.7 → 1.8.16 View file →
@@ -106,8 +106,18 @@
106 106
107 107 // get all shortcodes of any type
108 108 $shortcodes = $this->all();
109 109
110 + /**
111 + * Premature filtering of shortcodes not assigned to any page.
112 + *
113 + * @since 1.8.6
114 + */
115 + $shortcodes = array_values(array_filter($shortcodes, function($shortcode)
116 + {
117 + return !empty($shortcode->post_id);
118 + }));
119 +
110 120 // current language
111 121 $lang = is_null($lang) ? JFactory::getLanguage()->getTag() : $lang;
112 122
113 123 if (!count($shortcodes))
@@ -125,14 +135,8 @@
125 135 $last_count = 0;
126 136
127 137 foreach ($shortcodes as $k => $v)
128 138 {
129 - // ignore shortcodes not linked to a valid page
130 - if (empty($v->post_id))
131 - {
132 - continue;
133 - }
134 -
135 139 // start the score counter
136 140 $count = 0;
137 141
138 142 if (!strcasecmp($v->type, $reqview))