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 | * Routes configuration |
||
4 | * |
||
5 | * In this file, you set up routes to your controllers and their actions. |
||
6 | * Routes are very important mechanism that allows you to freely connect |
||
7 | * different URLs to chosen controllers and their actions (functions). |
||
8 | * |
||
9 | * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) |
||
10 | * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) |
||
11 | * |
||
12 | * Licensed under The MIT License |
||
13 | * For full copyright and license information, please see the LICENSE.txt |
||
14 | * Redistributions of files must retain the above copyright notice. |
||
15 | * |
||
16 | * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) |
||
17 | * @link http://cakephp.org CakePHP(tm) Project |
||
18 | * @package app.Config |
||
19 | * @since CakePHP(tm) v 0.2.9 |
||
20 | * @license http://www.opensource.org/licenses/mit-license.php MIT License |
||
21 | */ |
||
22 | /** |
||
23 | * Here, we are connecting '/' (base path) to controller called 'Pages', |
||
24 | * its action called 'display', and we pass a param to select the view file |
||
25 | * to use (in this case, /app/View/Pages/home.ctp)... |
||
26 | */ |
||
27 | //Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); |
||
28 | /** |
||
29 | * ...and connect the rest of 'Pages' controller's URLs. |
||
30 | */ |
||
31 | //Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); |
||
32 | |||
33 | $dominio = verificar_dominio(); |
||
34 | |||
35 | if ($dominio['is_winners']) { |
||
36 | Router::connect('/', array('controller' => 'home', 'action' => 'index')); |
||
37 | } else { |
||
38 | Router::connect('/', array('controller' => $dominio['controller'], 'action' => $dominio['funcao'])); |
||
39 | } |
||
40 | |||
41 | $caminho = APP . 'Config/routesshop.php'; |
||
42 | |||
43 | Router::connect('/servicos', array('controller' => 'home', 'action', 'servicos')); |
||
44 | Router::connect('/linha-do-tempo-winners-opensource', array('controller' => 'home', 'action' => 'timeline')); |
||
45 | Router::connect('/canal-para-desenvolvedores-winners', array('controller' => 'home', 'action' => 'developers')); |
||
46 | Router::connect('/clientes-erp-ecommerce-software-sob-medida-winners', array('controller' => 'home', 'action' => 'cases')); |
||
47 | Router::connect('/quero-saber-como-funciona-winners-opensource', array('controller' => 'home', 'action' => 'contact')); |
||
48 | |||
49 | require($caminho); |
||
50 | /** |
||
51 | * Load all plugin routes. See the CakePlugin documentation on |
||
52 | * how to customize the loading of plugin routes. |
||
53 | */ |
||
54 | CakePlugin::routes(); |
||
55 | |||
56 | /** |
||
57 | * Load the CakePHP default routes. Only remove this if you do not want to use |
||
58 | * the built-in default routes. |
||
59 | */ |
||
60 | require CAKE . 'Config' . DS . 'routes.php'; |
||
61 | /** |
||
62 | * Função para verificar se o dominio pentece ao site, caso não pertença redireciona ao site correto |
||
63 | */ |
||
64 | function verificar_dominio() { |
||
0 ignored issues
–
show
|
|||
65 | $dominiosWinners = array ( |
||
66 | 'winners.local', |
||
67 | 'blog.winnersdesenvolvimento.com.br', |
||
68 | 'ciawn.com.br', |
||
69 | 'www.ciawn.com.br', |
||
70 | 'api.ciawn.com.br', |
||
71 | 'winnersopensource.herokuapp.com' |
||
72 | ); |
||
73 | |||
74 | $dominiosWinnersRedirect = array( |
||
75 | 'www.winnersdesenvolvimento.com.br', |
||
76 | 'winnersdesenvolvimento.com.br', |
||
77 | ); |
||
78 | |||
79 | $varDominio = $_SERVER['SERVER_NAME']; |
||
80 | |||
81 | if (array_search($varDominio, $dominiosWinnersRedirect) !== false || $varDominio == "ciawn.com.br") { |
||
82 | header('Location: http://www.ciawn.com.br'); |
||
83 | exit(); |
||
0 ignored issues
–
show
The function verificar_dominio() contains an exit expression.
An exit expression should only be used in rare cases. For example, if you write a short command line script. In most cases however, using an ![]() |
|||
84 | } |
||
85 | |||
86 | if (array_search($varDominio, $dominiosWinners) !== false) { |
||
87 | $retorno['is_winners'] = true; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
$retorno was never initialized. Although not strictly required by PHP, it is generally a good practice to add $retorno = array(); before regardless.
Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code. Let’s take a look at an example: foreach ($collection as $item) {
$myArray['foo'] = $item->getFoo();
if ($item->hasBar()) {
$myArray['bar'] = $item->getBar();
}
// do something with $myArray
}
As you can see in this example, the array This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop. ![]() |
|||
88 | |||
89 | return $retorno; |
||
90 | } |
||
91 | |||
92 | if ($varDominio == "fastshipping.ciawn.com.br") |
||
93 | { |
||
94 | header('Location: https://fastshipping.ciawn.com.br'); |
||
95 | exit(); |
||
0 ignored issues
–
show
The function verificar_dominio() contains an exit expression.
An exit expression should only be used in rare cases. For example, if you write a short command line script. In most cases however, using an ![]() |
|||
96 | } |
||
97 | |||
98 | $caminho = APP . 'Config/Domain/' . $varDominio . '.php'; |
||
99 | if (!file_exists($caminho)) |
||
100 | { |
||
101 | $retorno['is_winners'] = true; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
$retorno was never initialized. Although not strictly required by PHP, it is generally a good practice to add $retorno = array(); before regardless.
Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code. Let’s take a look at an example: foreach ($collection as $item) {
$myArray['foo'] = $item->getFoo();
if ($item->hasBar()) {
$myArray['bar'] = $item->getBar();
}
// do something with $myArray
}
As you can see in this example, the array This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop. ![]() |
|||
102 | return $retorno; |
||
103 | } |
||
104 | |||
105 | require($caminho); |
||
106 | |||
107 | $retorno['is_winners'] = false; |
||
0 ignored issues
–
show
Coding Style
Comprehensibility
introduced
by
$retorno was never initialized. Although not strictly required by PHP, it is generally a good practice to add $retorno = array(); before regardless.
Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code. Let’s take a look at an example: foreach ($collection as $item) {
$myArray['foo'] = $item->getFoo();
if ($item->hasBar()) {
$myArray['bar'] = $item->getBar();
}
// do something with $myArray
}
As you can see in this example, the array This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop. ![]() |
|||
108 | $retorno['id_usuario'] = $dominio['id_usuario']; |
||
0 ignored issues
–
show
The variable
$dominio does not exist. Did you mean $dominiosWinners ?
This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name. The variable may have been renamed without also renaming all references. ![]() |
|||
109 | $retorno['controller'] = $dominio['controller']; |
||
0 ignored issues
–
show
The variable
$dominio does not exist. Did you mean $dominiosWinners ?
This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name. The variable may have been renamed without also renaming all references. ![]() |
|||
110 | $retorno['funcao'] = $dominio['funcao']; |
||
0 ignored issues
–
show
The variable
$dominio does not exist. Did you mean $dominiosWinners ?
This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name. The variable may have been renamed without also renaming all references. ![]() |
|||
111 | |||
112 | return $retorno; |
||
113 | } |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: