1 | <?php |
||
9 | class ElggPluginManifestParser17 extends \ElggPluginManifestParser { |
||
10 | /** |
||
11 | * The valid top level attributes and defaults for a 1.7 manifest |
||
12 | */ |
||
13 | protected $validAttributes = array( |
||
14 | 'author', 'version', 'description', 'website', |
||
15 | 'copyright', 'license', 'licence', 'elgg_version', |
||
16 | |||
17 | // were never really used and not enforced in code. |
||
18 | 'requires', 'recommends', 'conflicts', |
||
19 | |||
20 | // not a 1.7 field, but we need it |
||
21 | 'name', |
||
22 | ); |
||
23 | |||
24 | /** |
||
25 | * Parse a manifest object from 1.7 or earlier. |
||
26 | * |
||
27 | * @return void |
||
28 | */ |
||
29 | public function parse() { |
||
65 | |||
66 | /** |
||
67 | * Return an attribute in the manifest. |
||
68 | * |
||
69 | * Overrides \ElggPluginManifestParser::getAttribute() because before 1.8 |
||
70 | * there were no rules...weeeeeeeee! |
||
71 | * |
||
72 | * @param string $name Attribute name |
||
73 | * @return mixed |
||
74 | */ |
||
75 | public function getAttribute($name) { |
||
82 | } |
||
83 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.