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 | use Gettext\BaseTranslator; |
||
4 | |||
5 | /** |
||
6 | * Returns the translation of a string. |
||
7 | * |
||
8 | * @param string $original |
||
9 | * |
||
10 | * @return string |
||
11 | */ |
||
12 | function __($original) |
||
13 | { |
||
14 | $text = BaseTranslator::$current->gettext($original); |
||
15 | |||
16 | if (func_num_args() === 1) { |
||
17 | return $text; |
||
18 | } |
||
19 | |||
20 | $args = array_slice(func_get_args(), 1); |
||
21 | |||
22 | return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Noop, marks the string for translation but returns it unchanged. |
||
27 | * |
||
28 | * @param string $original |
||
29 | * |
||
30 | * @return string |
||
31 | */ |
||
32 | function noop__($original) |
||
33 | { |
||
34 | return $original; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Returns the singular/plural translation of a string. |
||
39 | * |
||
40 | * @param string $original |
||
41 | * @param string $plural |
||
42 | * @param string $value |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | View Code Duplication | function n__($original, $plural, $value) |
|
0 ignored issues
–
show
|
|||
47 | { |
||
48 | $text = BaseTranslator::$current->ngettext($original, $plural, $value); |
||
49 | |||
50 | if (func_num_args() === 3) { |
||
51 | return $text; |
||
52 | } |
||
53 | |||
54 | $args = array_slice(func_get_args(), 3); |
||
55 | |||
56 | return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Returns the translation of a string in a specific context. |
||
61 | * |
||
62 | * @param string $context |
||
63 | * @param string $original |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | View Code Duplication | function p__($context, $original) |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
68 | { |
||
69 | $text = BaseTranslator::$current->pgettext($context, $original); |
||
70 | |||
71 | if (func_num_args() === 2) { |
||
72 | return $text; |
||
73 | } |
||
74 | |||
75 | $args = array_slice(func_get_args(), 2); |
||
76 | |||
77 | return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); |
||
78 | } |
||
79 | |||
80 | /** |
||
81 | * Returns the translation of a string in a specific domain. |
||
82 | * |
||
83 | * @param string $domain |
||
84 | * @param string $original |
||
85 | * |
||
86 | * @return string |
||
87 | */ |
||
88 | View Code Duplication | function d__($domain, $original) |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
89 | { |
||
90 | $text = BaseTranslator::$current->dgettext($domain, $original); |
||
91 | |||
92 | if (func_num_args() === 2) { |
||
93 | return $text; |
||
94 | } |
||
95 | |||
96 | $args = array_slice(func_get_args(), 2); |
||
97 | |||
98 | return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); |
||
99 | } |
||
100 | |||
101 | /** |
||
102 | * Returns the translation of a string in a specific domain and context. |
||
103 | * |
||
104 | * @param string $domain |
||
105 | * @param string $context |
||
106 | * @param string $original |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | View Code Duplication | function dp__($domain, $context, $original) |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
111 | { |
||
112 | $text = BaseTranslator::$current->dpgettext($domain, $context, $original); |
||
113 | |||
114 | if (func_num_args() === 3) { |
||
115 | return $text; |
||
116 | } |
||
117 | |||
118 | $args = array_slice(func_get_args(), 3); |
||
119 | |||
120 | return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); |
||
121 | } |
||
122 | |||
123 | /** |
||
124 | * Returns the singular/plural translation of a string in a specific domain. |
||
125 | * |
||
126 | * @param string $domain |
||
127 | * @param string $original |
||
128 | * @param string $plural |
||
129 | * @param string $value |
||
130 | * |
||
131 | * @return string |
||
132 | */ |
||
133 | View Code Duplication | function dn__($domain, $original, $plural, $value) |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
134 | { |
||
135 | $text = BaseTranslator::$current->dngettext($domain, $original, $plural, $value); |
||
136 | |||
137 | if (func_num_args() === 4) { |
||
138 | return $text; |
||
139 | } |
||
140 | |||
141 | $args = array_slice(func_get_args(), 4); |
||
142 | |||
143 | return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); |
||
144 | } |
||
145 | |||
146 | /** |
||
147 | * Returns the singular/plural translation of a string in a specific context. |
||
148 | * |
||
149 | * @param string $context |
||
150 | * @param string $original |
||
151 | * @param string $plural |
||
152 | * @param string $value |
||
153 | * |
||
154 | * @return string |
||
155 | */ |
||
156 | View Code Duplication | function np__($context, $original, $plural, $value) |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
157 | { |
||
158 | $text = BaseTranslator::$current->npgettext($context, $original, $plural, $value); |
||
159 | |||
160 | if (func_num_args() === 4) { |
||
161 | return $text; |
||
162 | } |
||
163 | |||
164 | $args = array_slice(func_get_args(), 4); |
||
165 | |||
166 | return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); |
||
167 | } |
||
168 | |||
169 | /** |
||
170 | * Returns the singular/plural translation of a string in a specific domain and context. |
||
171 | * |
||
172 | * @param string $domain |
||
173 | * @param string $context |
||
174 | * @param string $original |
||
175 | * @param string $plural |
||
176 | * @param string $value |
||
177 | * |
||
178 | * @return string |
||
179 | */ |
||
180 | View Code Duplication | function dnp__($domain, $context, $original, $plural, $value) |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
181 | { |
||
182 | $text = BaseTranslator::$current->dnpgettext($domain, $context, $original, $plural, $value); |
||
183 | |||
184 | if (func_num_args() === 5) { |
||
185 | return $text; |
||
186 | } |
||
187 | |||
188 | $args = array_slice(func_get_args(), 5); |
||
189 | |||
190 | return is_array($args[0]) ? strtr($text, $args[0]) : vsprintf($text, $args); |
||
191 | } |
||
192 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.