Unverified Commit e8e6e75b authored by Matthew Wire's avatar Matthew Wire Committed by GitHub

Merge pull request #14010 from colemanw/assetCheck

Skip adding core resources when building assets
parents 2e47b4f3 60c3b6e9
......@@ -821,8 +821,8 @@ class CRM_Core_Resources {
) {
return TRUE;
}
$url = CRM_Utils_System::getUrlPath();
return (strpos($url, 'civicrm/ajax') === 0) || (strpos($url, 'civicrm/angular') === 0);
list($arg0, $arg1) = array_pad(explode('/', CRM_Utils_System::getUrlPath()), 2, '');
return ($arg0 === 'civicrm' && in_array($arg1, ['ajax', 'angularprofiles', 'asset']));
}
/**
......
......@@ -350,6 +350,7 @@ class CRM_Core_ResourcesTest extends CiviUnitTestCase {
return array(
array(array('q' => 'civicrm/ajax/foo'), TRUE),
array(array('q' => 'civicrm/angularprofiles/template'), TRUE),
array(array('q' => 'civicrm/asset/builder'), TRUE),
array(array('q' => 'civicrm/test/page'), FALSE),
array(array('q' => 'civicrm/test/page', 'snippet' => 'json'), TRUE),
array(array('q' => 'civicrm/test/page', 'snippet' => 'foo'), FALSE),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment