@@ 1102-1153 (lines=52) @@ | ||
1099 | $gh_project . '/releases' |
|
1100 | ); |
|
1101 | ||
1102 | foreach ($releases as $release) |
|
1103 | { |
|
1104 | $tag_name = $release->tag_name; |
|
1105 | $tag_part = explode(".", $tag_name); |
|
1106 | $undoted = str_replace('.', '', $tag_name); |
|
1107 | $excluded = 0; |
|
1108 | ||
1109 | if (version_compare(JVERSION[0], '2', 'eq')) |
|
1110 | { |
|
1111 | $excluded = 1; |
|
1112 | } |
|
1113 | elseif (version_compare(JVERSION[0], '3', 'eq')) |
|
1114 | { |
|
1115 | if ($tag_part[0] != '3') |
|
1116 | { |
|
1117 | $excluded = 1; |
|
1118 | } |
|
1119 | } |
|
1120 | elseif (version_compare(JVERSION[0], '4', 'ge')) |
|
1121 | { |
|
1122 | if ($tag_part[0] == '4' || $tag_part[0] == '3') |
|
1123 | { |
|
1124 | $excluded = 0; |
|
1125 | } |
|
1126 | else |
|
1127 | { |
|
1128 | $excluded = 1; |
|
1129 | } |
|
1130 | } |
|
1131 | ||
1132 | // Filtering by "is_numeric" disable betas or similar releases. |
|
1133 | if ($params->get('pre_stable', '0') == '0') |
|
1134 | { |
|
1135 | if (!in_array($tag_name, $versions) && is_numeric($undoted) && $excluded == 0) |
|
1136 | { |
|
1137 | $versions[] = $tag_name; |
|
1138 | JFactory::getApplication()->enqueueMessage( |
|
1139 | JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), |
|
1140 | 'notice'); |
|
1141 | } |
|
1142 | } |
|
1143 | else |
|
1144 | { |
|
1145 | if (!in_array($tag_name, $versions) && $excluded == 0) |
|
1146 | { |
|
1147 | $versions[] = $tag_name; |
|
1148 | JFactory::getApplication()->enqueueMessage( |
|
1149 | JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), |
|
1150 | 'notice'); |
|
1151 | } |
|
1152 | } |
|
1153 | } |
|
1154 | } |
|
1155 | catch (Exception $e) |
|
1156 | { |
@@ 86-137 (lines=52) @@ | ||
83 | $gh_project . '/releases' |
|
84 | ); |
|
85 | ||
86 | foreach ($releases as $release) |
|
87 | { |
|
88 | $tag_name = $release->tag_name; |
|
89 | $tag_part = explode(".", $tag_name); |
|
90 | $undoted = str_replace('.', '', $tag_name); |
|
91 | $excluded = 0; |
|
92 | ||
93 | if (version_compare(JVERSION[0], '2', 'eq')) |
|
94 | { |
|
95 | $excluded = 1; |
|
96 | } |
|
97 | elseif (version_compare(JVERSION[0], '3', 'eq')) |
|
98 | { |
|
99 | if ($tag_part[0] != '3') |
|
100 | { |
|
101 | $excluded = 1; |
|
102 | } |
|
103 | } |
|
104 | elseif (version_compare(JVERSION[0], '4', 'ge')) |
|
105 | { |
|
106 | if ($tag_part[0] == '4' || $tag_part[0] == '3') |
|
107 | { |
|
108 | $excluded = 0; |
|
109 | } |
|
110 | else |
|
111 | { |
|
112 | $excluded = 1; |
|
113 | } |
|
114 | } |
|
115 | ||
116 | // Filtering by "is_numeric" disable betas or similar releases. |
|
117 | if ($params->get('pre_stable', '0') == '0') |
|
118 | { |
|
119 | if (!in_array($tag_name, $versions) && is_numeric($undoted) && $excluded == 0) |
|
120 | { |
|
121 | $versions[] = $tag_name; |
|
122 | JFactory::getApplication()->enqueueMessage( |
|
123 | JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), |
|
124 | 'notice'); |
|
125 | } |
|
126 | } |
|
127 | else |
|
128 | { |
|
129 | if (!in_array($tag_name, $versions) && $excluded == 0) |
|
130 | { |
|
131 | $versions[] = $tag_name; |
|
132 | JFactory::getApplication()->enqueueMessage( |
|
133 | JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), |
|
134 | 'notice'); |
|
135 | } |
|
136 | } |
|
137 | } |
|
138 | } |
|
139 | catch (Exception $e) |
|
140 | { |