Skip to content

Commit ea0d84d

Browse files
committed
Changed static export to not export robots.txt files of type seo_file.
1 parent 3a67f53 commit ea0d84d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/org/opencms/staticexport/CmsStaticExportManager.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import org.opencms.security.CmsSecurityException;
5656
import org.opencms.site.CmsSite;
5757
import org.opencms.site.CmsSiteManagerImpl;
58+
import org.opencms.site.xmlsitemap.CmsXmlSeoConfiguration;
5859
import org.opencms.staticexport.CmsExportname.CmsExportNameComparator;
5960
import org.opencms.util.CmsFileUtil;
6061
import org.opencms.util.CmsMacroResolver;
@@ -1869,8 +1870,16 @@ public boolean isExportLink(CmsObject cms, String vfsName) {
18691870
// not the current users permissions
18701871
CmsObject exportCms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserExport());
18711872
exportCms.getRequestContext().setSiteRoot(siteRoot);
1872-
// let's look up export property in VFS
1873+
// exportRes is usually the resource at path vfsName, but in case of detail page URIs it's the detail content
18731874
CmsResource exportRes = CmsDetailPageUtil.lookupPage(exportCms, vfsName);
1875+
// if we are handling request for robots.txt, don't export
1876+
if (OpenCms.getResourceManager().matchResourceType(
1877+
CmsXmlSeoConfiguration.SEO_FILE_TYPE,
1878+
exportRes.getTypeId())) {
1879+
if (vfsName.endsWith("robots.txt")) {
1880+
return false;
1881+
}
1882+
}
18741883
String exportValue = exportCms.readPropertyObject(
18751884
exportCms.getSitePath(exportRes),
18761885
CmsPropertyDefinition.PROPERTY_EXPORT,

0 commit comments

Comments
 (0)