PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/Helpers/global/url.php +17 -2 11.0.1 → 11.1.0 View file →
@@ -151,13 +151,28 @@
151 151 {
152 152 $base = str_replace(['http://www.', 'https://www.', 'http://', 'https://'], '', ACYM_LIVE);
153 153 $replacements = ['https://www.'.$base, 'http://www.'.$base, 'https://'.$base, 'http://'.$base];
154 154 foreach ($replacements as $oneReplacement) {
155 - if (strpos($url, $oneReplacement) === false) {
155 + $position = strpos($url, $oneReplacement);
156 + if ($position === false) {
156 157 continue;
157 158 }
158 159
159 - return str_replace([$oneReplacement, '/'], [ACYM_ROOT, DS], urldecode($url));
160 + // Remove parameters
161 + $relativeUrl = substr($url, $position + strlen($oneReplacement));
162 + $relativeUrl = preg_replace('/[?#].*$/', '', $relativeUrl);
163 +
164 + // Remove encoded / and .
165 + $segments = [];
166 + foreach (explode('/', $relativeUrl) as $oneSegment) {
167 + $decodedSegment = urldecode($oneSegment);
168 + if (preg_match('#[/\\\\?\#]#', $decodedSegment) === 1 || in_array($decodedSegment, ['.', '..'], true)) {
169 + return $url;
170 + }
171 + $segments[] = $decodedSegment;
172 + }
173 +
174 + return ACYM_ROOT.implode(DS, $segments);
160 175 }
161 176
162 177 return $url;
163 178 }