File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 99require_once __DIR__ . '/vendor/autoload.php ' ;
1010require_once __DIR__ . '/src/Response.php ' ;
1111
12+ // Check if this is a request for the enterprise version endpoint
13+ if (isset ($ _SERVER ['PATH_INFO ' ]) && $ _SERVER ['PATH_INFO ' ] === '/enterprise-version ' ) {
14+ // Set Content-Type to JSON
15+ header ('Content-Type: application/json ' );
16+ // Enforce browser based XSS filters
17+ header ('X-XSS-Protection: 1; mode=block ' );
18+ // Disable sniffing the content type for IE
19+ header ('X-Content-Type-Options: nosniff ' );
20+ // Disallow iFraming from other domains
21+ header ('X-Frame-Options: Sameorigin ' );
22+ // https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag
23+ header ('X-Robots-Tag: none ' );
24+
25+ // Extract enterpriseVersion from the config file by parsing it
26+ $ configContent = file_get_contents (__DIR__ . '/config/config.php ' );
27+ preg_match ('/\$enterpriseVersion\s*=\s*[ \'"]([^ \'"]+)[ \'"]/ ' , $ configContent , $ matches );
28+ $ enterpriseVersion = isset ($ matches [1 ]) ? $ matches [1 ] : null ;
29+
30+ echo json_encode (['enterpriseVersion ' => $ enterpriseVersion ]);
31+ exit ();
32+ }
33+
1234// Set Content-Type to XML
1335header ('Content-Type: application/xml ' );
1436// Enforce browser based XSS filters
You can’t perform that action at this time.
0 commit comments