Code Duplication    Length = 8-10 lines in 2 locations

engine/classes/Elgg/CacheHandler.php 1 location

@@ 197-206 (lines=10) @@
194
	 */
195
	protected function sendContentType($view) {
196
		$segments = explode('/', $view, 2);
197
		switch ($segments[0]) {
198
			case 'css':
199
				header("Content-Type: text/css;charset=utf-8");
200
				break;
201
			case 'js':
202
				header('Content-Type: text/javascript;charset=utf-8');
203
				break;
204
			default:
205
				header('Content-Type: text/html;charset=utf-8');
206
		}
207
	}
208
209
	/**

engine/lib/elgglib.php 1 location

@@ 1512-1519 (lines=8) @@
1509
1510
		if ($segments[0] === 'view') {
1511
			// Try to guess the mime-type
1512
			switch ($segments[1]) {
1513
				case "js":
1514
					header("Content-Type: text/javascript;charset=utf-8");
1515
					break;
1516
				case "css":
1517
					header("Content-Type: text/css;charset=utf-8");
1518
					break;
1519
			}
1520
1521
			echo elgg_view($view, $vars);
1522
		} else {