File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,14 +97,16 @@ public function validateStore($storeCode)
9797 */
9898 public function getRequestToWebsiteId ($ request )
9999 {
100- $ baseUrl = str_replace ('www. ' , '' , $ request ->getDistroBaseUrl ());
100+ $ baseUrl = str_replace ('www. ' , '% ' , $ request ->getDistroBaseUrl ());
101+ // Strip schemas
102+ $ baseUrl = str_replace (['https:// ' , 'http:// ' ], '' , $ baseUrl );
101103
102104 $ connection = $ this ->resource ->getConnection ();
103105 $ table = $ connection ->getTableName ('core_config_data ' );
104106 $ websiteFilter = $ connection ->select ()->from ($ table , ['scope_id ' ])
105107 ->where ('scope = ? ' , 'websites ' )
106108 ->where ('path in (?) ' , [Custom::XML_PATH_SECURE_BASE_URL , Custom::XML_PATH_UNSECURE_BASE_URL ])
107- ->where ('value = ? ' , $ baseUrl );
109+ ->where ('value like ? ' , " % $ baseUrl" );
108110 $ match = $ connection ->fetchCol ($ websiteFilter );
109111
110112 return count ($ match ) > 0 ? (int )$ match [0 ] : null ;
You can’t perform that action at this time.
0 commit comments