aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs30
1 files changed, 22 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
index c8e72ca..cbe9af2 100644
--- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
+++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs
@@ -458,22 +458,36 @@ namespace OpenSim.Region.CoreModules.Media.Moap
458 { 458 {
459 Uri url = new Uri(rawUrl); 459 Uri url = new Uri(rawUrl);
460 460
461 foreach (string rawWlUrl in whitelist) 461 foreach (string origWlUrl in whitelist)
462 { 462 {
463 string wlUrl = rawWlUrl; 463 string wlUrl = origWlUrl;
464 464
465 // Deal with a line-ending wildcard 465 // Deal with a line-ending wildcard
466 if (wlUrl.EndsWith("*")) 466 if (wlUrl.EndsWith("*"))
467 wlUrl = wlUrl.Remove(wlUrl.Length - 1); 467 wlUrl = wlUrl.Remove(wlUrl.Length - 1);
468 468
469 m_log.DebugFormat("[MOAP]: Checking whitelist URL {0}", wlUrl); 469 m_log.DebugFormat("[MOAP]: Checking whitelist URL pattern {0}", origWlUrl);
470 470
471 string urlToMatch = url.Authority + url.AbsolutePath; 471 // Handle a line starting wildcard slightly differently since this can only match the domain, not the path
472 472 if (wlUrl.StartsWith("*"))
473 if (urlToMatch.StartsWith(wlUrl)) 473 {
474 wlUrl = wlUrl.Substring(1);
475
476 if (url.Host.Contains(wlUrl))
477 {
478 m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl);
479 return true;
480 }
481 }
482 else
474 { 483 {
475 m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", wlUrl, urlToMatch); 484 string urlToMatch = url.Authority + url.AbsolutePath;
476 return true; 485
486 if (urlToMatch.StartsWith(wlUrl))
487 {
488 m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl);
489 return true;
490 }
477 } 491 }
478 } 492 }
479 493