This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
|||||||||||
2 | /** |
|||||||||||
3 | * Page |
|||||||||||
4 | * |
|||||||||||
5 | * @author Sune Jensen <[email protected]> |
|||||||||||
6 | * @author Lars Olesen <[email protected]> |
|||||||||||
7 | * |
|||||||||||
8 | */ |
|||||||||||
9 | class Intraface_Page |
|||||||||||
10 | { |
|||||||||||
11 | public $kernel; |
|||||||||||
12 | public $db; |
|||||||||||
13 | public $theme; |
|||||||||||
14 | public $usermenu; |
|||||||||||
15 | public $submenu; |
|||||||||||
16 | public $menu; |
|||||||||||
17 | public $javascript_path = array(); |
|||||||||||
18 | public $primary_module; |
|||||||||||
19 | ||||||||||||
20 | function __construct(Intraface_Kernel $object_kernel, MDB2_Driver_Common $db = null) |
|||||||||||
21 | { |
|||||||||||
22 | $this->kernel = $object_kernel; |
|||||||||||
23 | if ($this->db == null) { |
|||||||||||
24 | $this->db = MDB2::singleton(DB_DSN); |
|||||||||||
25 | } else { |
|||||||||||
26 | $this->db = $db; |
|||||||||||
27 | } |
|||||||||||
28 | } |
|||||||||||
29 | ||||||||||||
30 | function start($title = '') |
|||||||||||
31 | { |
|||||||||||
32 | $this->primary_module = $this->kernel->getPrimaryModule(); |
|||||||||||
33 | $name = ''; |
|||||||||||
0 ignored issues
–
show
|
||||||||||||
34 | if (is_object($this->primary_module)) { |
|||||||||||
35 | $name = $this->primary_module->getName(); |
|||||||||||
0 ignored issues
–
show
$name is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the ![]() |
||||||||||||
36 | } |
|||||||||||
37 | ||||||||||||
38 | /* |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
55% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
39 | // brugermenuen |
|||||||||||
40 | // Unforntunately the usermenuen has to be before the cache as it is printed in bottom.php. |
|||||||||||
41 | $this->usermenu = array(); |
|||||||||||
42 | $this->usermenu[0]['name'] = $this->t('logout', 'common'); |
|||||||||||
43 | $this->usermenu[0]['url'] = url('/core/logout'); |
|||||||||||
44 | if (method_exists('getIntranetList', $this->kernel->user)) { |
|||||||||||
45 | if (count($this->kernel->user->getIntranetList()) > 1) { |
|||||||||||
46 | $this->usermenu[1]['name'] = $this->t('change intranet', 'common'); |
|||||||||||
47 | $this->usermenu[1]['url'] = url('/main/change_intranet.php'); |
|||||||||||
48 | } |
|||||||||||
49 | } |
|||||||||||
50 | $this->usermenu[2]['name'] = $this->t('control panel', 'common');; |
|||||||||||
51 | $this->usermenu[2]['url'] = url('/core/restricted/module/controlpanel/'); |
|||||||||||
52 | */ |
|||||||||||
53 | /* |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
42% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
54 | if (!is_dir(PATH_CACHE)) { |
|||||||||||
55 | if (!mkdir(PATH_CACHE)) { |
|||||||||||
56 | throw new Exception('Unable to create dir "'.PATH_CACHE.'" from constant PATH_CACHE'); |
|||||||||||
57 | exit; |
|||||||||||
58 | } |
|||||||||||
59 | chmod(PATH_CACHE, 644); |
|||||||||||
60 | } |
|||||||||||
61 | ||||||||||||
62 | $options = array( |
|||||||||||
63 | 'cacheDir' => PATH_CACHE, |
|||||||||||
64 | 'lifeTime' => 3600 |
|||||||||||
65 | ); |
|||||||||||
66 | $cache = new Cache_Lite_Output($options); |
|||||||||||
67 | ||||||||||||
68 | // unfortunately cache has to be deactivated (true or) as there is problems with titel and javascript. solution: only caching of menu and nothing else. |
|||||||||||
69 | // If you activate again remeber to activate $cache->end() in the end of this method |
|||||||||||
70 | if (true or defined('USE_CACHE') AND !USE_CACHE OR !($cache->start('page_' . $this->kernel->user->get('id') . '_' . $name))) { |
|||||||||||
71 | if (!is_object($this->kernel->translation)) $this->kernel->getTranslation(); |
|||||||||||
72 | */ |
|||||||||||
73 | $intranet_name = $this->kernel->intranet->get('name'); |
|||||||||||
0 ignored issues
–
show
The method
get does only exist in FakeDebtorIntranet and Intraface_Intranet , but not in FakeKernelIntranet and F...nelIntranetWithNoAccess .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
||||||||||||
74 | ||||||||||||
75 | if (empty($title)) { |
|||||||||||
76 | $title = $intranet_name; |
|||||||||||
0 ignored issues
–
show
$title is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the ![]() |
||||||||||||
77 | } |
|||||||||||
78 | ||||||||||||
79 | // temaet |
|||||||||||
80 | $themes = self::themes(); |
|||||||||||
0 ignored issues
–
show
$themes is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the ![]() |
||||||||||||
81 | $this->theme_key = $this->kernel->setting->get('user', 'theme'); |
|||||||||||
0 ignored issues
–
show
The property
theme_key does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
||||||||||||
82 | ||||||||||||
83 | // fontsize |
|||||||||||
84 | $this->fontsize = $this->kernel->setting->get('user', 'ptextsize'); |
|||||||||||
0 ignored issues
–
show
The property
fontsize does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
||||||||||||
85 | ||||||||||||
86 | ||||||||||||
87 | // menuen |
|||||||||||
88 | $this->menu = array(); |
|||||||||||
89 | $i = 0; |
|||||||||||
90 | $this->menu[$i]['name'] = $this->t('dashboard', 'dashboard'); |
|||||||||||
91 | ; |
|||||||||||
92 | $this->menu[$i]['url'] = url('/core/restricted/'); |
|||||||||||
93 | $i++; |
|||||||||||
94 | $res = $this->db->query("SELECT name, menu_label, name FROM module WHERE active = 1 AND show_menu = 1 ORDER BY menu_index"); |
|||||||||||
95 | foreach ($res->fetchAll() as $row) { |
|||||||||||
96 | if ($this->kernel->user->hasModuleAccess($row['name'])) { |
|||||||||||
0 ignored issues
–
show
The call to
FakeKernelIntranetWithNoAccess::hasModuleAccess() has too many arguments starting with $row['name'] .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The call to
FakeKernelIntranet::hasModuleAccess() has too many arguments starting with $row['name'] .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The call to
FakeDebtorUser::hasModuleAccess() has too many arguments starting with $row['name'] .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
||||||||||||
97 | $this->menu[$i]['name'] = $this->t($row['name'], $row['name']); |
|||||||||||
98 | $this->menu[$i]['url'] = url('/core/restricted/module/' . $row["name"]); |
|||||||||||
99 | $i++; |
|||||||||||
100 | } |
|||||||||||
101 | } |
|||||||||||
102 | ||||||||||||
103 | $submenu = array(); |
|||||||||||
0 ignored issues
–
show
$submenu is not used, you could remove the assignment.
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently. $myVar = 'Value';
$higher = false;
if (rand(1, 6) > 3) {
$higher = true;
} else {
$higher = false;
}
Both the ![]() |
||||||||||||
104 | if (is_object($this->primary_module)) { |
|||||||||||
105 | $all_submenu = $this->primary_module->getSubmenu(); |
|||||||||||
106 | if (count($all_submenu) > 0) { // added to avoid error messages |
|||||||||||
107 | $j = 0; |
|||||||||||
108 | for ($i = 0, $max = count($all_submenu); $i < $max; $i++) { |
|||||||||||
109 | $access = false; |
|||||||||||
110 | ||||||||||||
111 | View Code Duplication | if ($all_submenu[$i]['sub_access'] != '') { |
||||||||||
112 | $sub = explode(":", $all_submenu[$i]['sub_access']); |
|||||||||||
113 | ||||||||||||
114 | switch ($sub[0]) { |
|||||||||||
115 | case 'sub_access': |
|||||||||||
116 | if ($this->kernel->user->hasSubAccess($this->primary_module->module_name, $sub[1])) { |
|||||||||||
0 ignored issues
–
show
The method
hasSubAccess does only exist in Intraface_User , but not in FakeDebtorUser and FakeK...nelIntranetWithNoAccess .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
||||||||||||
117 | $access = true; |
|||||||||||
118 | } |
|||||||||||
119 | break; |
|||||||||||
120 | ||||||||||||
121 | case 'module': |
|||||||||||
122 | if ($this->kernel->user->hasModuleAccess($sub[1])) { |
|||||||||||
0 ignored issues
–
show
The call to
FakeKernelIntranetWithNoAccess::hasModuleAccess() has too many arguments starting with $sub[1] .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The call to
FakeKernelIntranet::hasModuleAccess() has too many arguments starting with $sub[1] .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() The call to
FakeDebtorUser::hasModuleAccess() has too many arguments starting with $sub[1] .
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. In this case you can add the ![]() |
||||||||||||
123 | $access = true; |
|||||||||||
124 | } |
|||||||||||
125 | break; |
|||||||||||
126 | ||||||||||||
127 | default: |
|||||||||||
128 | throw new Exception('Der er ikke angivet om submenu skal tjekke efter sub_access eller module adgang, for undermenupunktet i Page->start();'); |
|||||||||||
129 | break; |
|||||||||||
0 ignored issues
–
show
break; does not seem to be reachable.
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed. Unreachable code is most often the result of function fx() {
try {
doSomething();
return true;
}
catch (\Exception $e) {
return false;
}
return false;
}
In the above example, the last ![]() |
||||||||||||
130 | } |
|||||||||||
131 | } else { |
|||||||||||
132 | $access = true; |
|||||||||||
133 | } |
|||||||||||
134 | ||||||||||||
135 | View Code Duplication | if ($access) { |
||||||||||
136 | $this->submenu[$j]['name'] = $this->t($all_submenu[$i]['label'], $this->primary_module->getName()); |
|||||||||||
137 | $this->submenu[$j]['url'] = $this->primary_module->getPath(). $all_submenu[$i]['url']; |
|||||||||||
138 | $j++; |
|||||||||||
139 | } |
|||||||||||
140 | } |
|||||||||||
141 | } |
|||||||||||
142 | } |
|||||||||||
143 | ||||||||||||
144 | $javascript = ''; |
|||||||||||
145 | if (!empty($this->javascript_path) and count($this->javascript_path) > 0) { |
|||||||||||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
Using logical operators such as
and instead of && is generally not recommended.
PHP has two types of connecting operators (logical operators, and boolean operators):
The difference between these is the order in which they are executed. In most cases,
you would want to use a boolean operator like Let’s take a look at a few examples: // Logical operators have lower precedence:
$f = false or true;
// is executed like this:
($f = false) or true;
// Boolean operators have higher precedence:
$f = false || true;
// is executed like this:
$f = (false || true);
Logical Operators are used for Control-FlowOne case where you explicitly want to use logical operators is for control-flow such as this: $x === 5
or die('$x must be 5.');
// Instead of
if ($x !== 5) {
die('$x must be 5.');
}
Since // The following is currently a parse error.
$x === 5
or throw new RuntimeException('$x must be 5.');
These limitations lead to logical operators rarely being of use in current PHP code. ![]() |
||||||||||||
146 | for ($i = 0, $max = count($this->javascript_path); $i < $max; $i++) { |
|||||||||||
147 | $javascript .= '<script type="text/javascript" src="'.$this->javascript_path[$i].'"></script>' . "\n"; |
|||||||||||
148 | } |
|||||||||||
149 | } |
|||||||||||
150 | /* |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
56% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
151 | $systemdisturbance = new SystemDisturbance($this->kernel); |
|||||||||||
152 | $now = $systemdisturbance->getActual(); |
|||||||||||
153 | ||||||||||||
154 | if (!empty($now) AND count($now) > 0 && $now['important'] == 1) { |
|||||||||||
155 | $system_message = $now['description']; |
|||||||||||
156 | } |
|||||||||||
157 | */ |
|||||||||||
158 | ||||||||||||
159 | ||||||||||||
160 | //header('Vary: Accept'); |
|||||||||||
161 | // setting headers to prevent browser to cache page |
|||||||||||
162 | // jf. http://dk.php.net/header/ |
|||||||||||
163 | ||||||||||||
164 | //header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
67% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
165 | //header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
48% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
166 | ||||||||||||
167 | // HTTP/1.1 |
|||||||||||
168 | //header('Cache-Control: no-store, no-cache, must-revalidate'); |
|||||||||||
169 | //header('Cache-Control: post-check=0, pre-check=0', false); |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
75% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
170 | ||||||||||||
171 | // HTTP/1.0 |
|||||||||||
172 | //header('Pragma: no-cache'); |
|||||||||||
173 | ||||||||||||
174 | /* |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
49% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
175 | if (defined('OB_START') AND OB_START == 'use') { |
|||||||||||
176 | ob_start(); // OB_HANDLER |
|||||||||||
177 | } |
|||||||||||
178 | */ |
|||||||||||
179 | ||||||||||||
180 | //contentNegotiation(CONTENTNEGOTIATION); |
|||||||||||
181 | ||||||||||||
182 | //include(PATH_INCLUDE_IHTML.'/intraface/top.php'); |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
72% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
183 | ||||||||||||
184 | // $cache->end(); |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
72% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
185 | //} |
|||||||||||
186 | } |
|||||||||||
187 | ||||||||||||
188 | function end() |
|||||||||||
189 | { |
|||||||||||
190 | $this->usermenu = array(); |
|||||||||||
191 | $this->usermenu[0]['name'] = $this->t('logout', 'common'); |
|||||||||||
192 | $this->usermenu[0]['url'] = url('/core/logout'); |
|||||||||||
193 | ||||||||||||
194 | if (method_exists($this->kernel->user, 'getIntranetList')) { |
|||||||||||
195 | View Code Duplication | if (count($this->kernel->user->getIntranetList()) > 1) { |
||||||||||
0 ignored issues
–
show
The method
getIntranetList does only exist in Intraface_User , but not in FakeDebtorUser and FakeK...nelIntranetWithNoAccess .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
||||||||||||
196 | $this->usermenu[1]['name'] = $this->t('change intranet', 'common'); |
|||||||||||
197 | $this->usermenu[1]['url'] = url('/core/restricted/switchintranet'); |
|||||||||||
198 | } |
|||||||||||
199 | } |
|||||||||||
200 | $this->usermenu[2]['name'] = $this->t('control panel', 'common'); |
|||||||||||
201 | ; |
|||||||||||
202 | $this->usermenu[2]['url'] = url('/core/restricted/module/controlpanel'); |
|||||||||||
203 | ||||||||||||
204 | //include(PATH_INCLUDE_IHTML.'/intraface/bottom.php'); |
|||||||||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
72% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
||||||||||||
205 | } |
|||||||||||
206 | ||||||||||||
207 | function includeJavascript($scope, $filename) |
|||||||||||
208 | { |
|||||||||||
209 | if (!in_array($scope, array('global', 'module'), true)) { |
|||||||||||
210 | throw new Exception("F�rste parameter er ikke enten 'global' eller 'module' i Page->includeJavascript"); |
|||||||||||
211 | } |
|||||||||||
212 | ||||||||||||
213 | if ($scope == 'global') { |
|||||||||||
214 | $this->javascript_path[] = url('/javascript/'.$filename); |
|||||||||||
215 | } else { |
|||||||||||
216 | $this->javascript_path[] = 'javascript/'.$filename; |
|||||||||||
217 | } |
|||||||||||
218 | } |
|||||||||||
219 | ||||||||||||
220 | function addJavascript($url) |
|||||||||||
221 | { |
|||||||||||
222 | $this->javascript_path[] = $url; |
|||||||||||
223 | } |
|||||||||||
224 | ||||||||||||
225 | public static function themes() |
|||||||||||
226 | { |
|||||||||||
227 | return array( |
|||||||||||
228 | 1 => array( |
|||||||||||
229 | 'label' => 'system', |
|||||||||||
230 | 'dir' => '/system/', |
|||||||||||
231 | 'name' => 'Web 2.0', |
|||||||||||
232 | 'description' => 'Spr�lsk, vildt og pastel.' |
|||||||||||
233 | ), |
|||||||||||
234 | 2 => array( |
|||||||||||
235 | 'label' => 'newsystem', |
|||||||||||
236 | 'dir' => '/newsystem/', |
|||||||||||
237 | 'name' => 'Standard', |
|||||||||||
238 | 'description' => 'Standard.' |
|||||||||||
239 | ), |
|||||||||||
240 | 3 => array( |
|||||||||||
241 | 'label' => 'black', |
|||||||||||
242 | 'dir' => '/black/', |
|||||||||||
243 | 'name' => 'Den sorte ridder', |
|||||||||||
244 | 'description' => 'Det gamle tema. Nydeligt og kedeligt.' |
|||||||||||
245 | ) |
|||||||||||
246 | ); |
|||||||||||
247 | } |
|||||||||||
248 | ||||||||||||
249 | function t($phrase, $page_id = null) |
|||||||||||
250 | { |
|||||||||||
251 | return $this->kernel->translation->get($phrase, $page_id); |
|||||||||||
252 | } |
|||||||||||
253 | } |
|||||||||||
254 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.