Code Duplication    Length = 7-9 lines in 2 locations

lib/private/preview/movie.php 1 location

@@ 11-17 (lines=7) @@
8
 */
9
namespace OC\Preview;
10
11
function findBinaryPath($program) {
12
	exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
13
	if ($returnCode === 0 && count($output) > 0) {
14
		return escapeshellcmd($output[0]);
15
	}
16
	return null;
17
}
18
19
// movie preview is currently not supported on Windows
20
if (!\OC_Util::runningOnWindows()) {

settings/admin.php 1 location

@@ 97-105 (lines=9) @@
94
 * @param string $program
95
 * @return null|string
96
 */
97
function findBinaryPath($program) {
98
	if (OC_Helper::is_function_enabled('exec')) {
99
		exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
100
		if ($returnCode === 0 && count($output) > 0) {
101
			return escapeshellcmd($output[0]);
102
		}
103
	}
104
	return null;
105
}
106