Commit 5f5f36a6 by Scott

Fix offset in file_get_contents

Fixes #487
parent 460b507d
......@@ -44,7 +44,7 @@ class Q2A_Plugin_PluginManager
$metadata = $metadataUtil->fetchFromAddonPath($pluginDirectory);
if (empty($metadata)) {
// limit plugin parsing to first 8kB
$contents = file_get_contents($pluginFile, false, null, -1, 8192);
$contents = file_get_contents($pluginFile, false, null, 0, 8192);
$metadata = qa_addon_metadata($contents, 'Plugin', true);
}
......
......@@ -152,7 +152,7 @@ function qa_admin_theme_options()
$metadata = $metadataUtil->fetchFromAddonPath($directory);
if (empty($metadata)) {
// limit theme parsing to first 8kB
$contents = file_get_contents($directory . '/qa-styles.css', false, null, -1, 8192);
$contents = file_get_contents($directory . '/qa-styles.css', false, null, 0, 8192);
$metadata = qa_addon_metadata($contents, 'Theme');
}
$options[$theme] = isset($metadata['name']) ? $metadata['name'] : $theme;
......
......@@ -1038,7 +1038,7 @@ foreach ($showoptions as $optionname) {
$metadata = $metadataUtil->fetchFromAddonPath($themedirectory);
if (empty($metadata)) {
// limit theme parsing to first 8kB
$contents = file_get_contents($themedirectory . '/qa-styles.css', false, null, -1, 8192);
$contents = file_get_contents($themedirectory . '/qa-styles.css', false, null, 0, 8192);
$metadata = qa_addon_metadata($contents, 'Theme');
}
......
......@@ -127,7 +127,7 @@ if (!empty($fileSystemPlugins)) {
$pluginFile = $pluginDirectoryPath . '/qa-plugin.php';
// limit plugin parsing to first 8kB
$contents = file_get_contents($pluginFile, false, null, -1, 8192);
$contents = file_get_contents($pluginFile, false, null, 0, 8192);
$metadata = qa_addon_metadata($contents, 'Plugin');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment