Passed
Branch master (380e00)
by Greg
20:17
created

print_navigator_family()   D

Complexity

Conditions 9
Paths 9

Size

Total Lines 39
Code Lines 34

Duplication

Lines 37
Ratio 94.87 %

Importance

Changes 0
Metric Value
cc 9
eloc 34
nc 9
nop 2
dl 37
loc 39
rs 4.909
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 130 and the first side effect is on line 23.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * webtrees: online genealogy
4
 * Copyright (C) 2017 webtrees development team
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
 * GNU General Public License for more details.
13
 * You should have received a copy of the GNU General Public License
14
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15
 */
16
namespace Fisharebest\Webtrees;
17
18
/**
19
 * Defined in edit_interface.php
20
 *
21
 * @global Individual $person
22
 */
23
global $person;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
24
/**
25
 * Defined in edit_interface.php
26
 *
27
 * @global Controller\PageController $controller
28
 */
29
global $controller;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
30
31
?>
32
<style>
33
	/* Outer border around nav elements */
34
	.outer_nav {
35
		border: 3px #808080 outset;
36
	}
37
38
	/* top Search box */
39
	input[type='text'] {
40
		background: #fff;
41
		color: #000;
42
		border: 1px solid #000;
43
		width: 120px;
44
	}
45
46
	/* "Head" button images */
47
	.headimg {
48
		margin-top: -4px;
49
		border: 0;
50
	}
51
52
	/* Prevents clickable td for Search <td> */
53
	td #srch a {
54
		display: inline;
55
	}
56
</style>
57
<div id="media-links">
58
	<table class="center">
59
		<tr>
60
			<td class="topbottombar">
61
				<b><?= $controller->getPageTitle() ?></b>
62
			</td>
63
		</tr>
64
		<tr>
65
			<td>
66
				<table class="outer_nav">
67
					<tr>
68
						<th class="descriptionbox"><?= I18N::translate('Find an individual') ?></th>
69
					</tr>
70
					<tr>
71
						<td id="srch" class="optionbox center">
72
							<script>
73
								function findindi() {
74
									var findInput = document.getElementById('personid');
75
									var txt = findInput.value;
76
									if (txt === "") {
77
										alert("<?= I18N::translate('You must enter a name') ?>");
78
									} else {
79
										window.open("module.php?mod=GEDFact_assistant&mod_action=media_find&callback=paste_id&action=filter&type=indi&multiple=&filter=" + txt, "win02", "resizable=1, menubar=0, scrollbars=1, top=180, left=600, height=600, width=450 ").focus();
80
									}
81
								}
82
							</script>
83
							<input id="personid" type="text" value="">
84
							<a type="submit" onclick="findindi();">
85
								<?= I18N::translate('Search') ?>
86
							</a>
87
						</td>
88
					</tr>
89
					<tr>
90
						<td>
91
							<table width="100%" class="fact_table" cellspacing="0" border="0">
92
								<tr>
93
									<td colspan=3 class="descriptionbox wrap">
94
										<i class="headimg vmiddle icon-button_head"></i>
95
										<?= I18N::translate('View this family') ?>
96
									</td>
97
								</tr>
98
								<?php
99
								foreach ($person->getChildFamilies() as $family) {
100
									echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
101
									print_navigator_family($family, $person);
102
								}
103
104
								foreach ($person->getChildStepFamilies() as $family) {
105
									echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
106
									print_navigator_family($family, $person);
107
								}
108
109
								foreach ($person->getSpouseFamilies() as $family) {
110
									echo '<tr><th colspan="2">', $family->getFullName(), '</td></tr>';
111
									print_navigator_family($family, $person);
112
								}
113
								?>
114
							</table>
115
						</td>
116
					</tr>
117
				</table>
118
			</td>
119
		</tr>
120
	</table>
121
</div>
122
<?php
123
124
/**
125
 * Display family members with clickable links
126
 *
127
 * @param Family     $family
128
 * @param Individual $individual
129
 */
130
function print_navigator_family(Family $family, Individual $individual) {
131 View Code Duplication
	foreach ($family->getSpouses() as $spouse) {
132
		?>
133
		<tr>
134
			<td>
135
				<a href="#" onclick="opener.insertRowToTable('<?= $spouse->getXref() ?>', '<?= Html::escape($spouse->getFullName()) ?>', '', '', '', '', '', '', '', ''); return false;">
0 ignored issues
show
Security Cross-Site Scripting introduced by
$spouse->getXref() can contain request data and is used in html attribute with single-quotes context(s) leading to a potential security vulnerability.

11 paths for user data to reach this point

  1. Path: $this->parameters['HTTP_AUTHORIZATION'] seems to return tainted data, and $authorizationHeader is assigned in ServerBag.php on line 62
  1. $this->parameters['HTTP_AUTHORIZATION'] seems to return tainted data, and $authorizationHeader is assigned
    in vendor/ServerBag.php on line 62
  2. ParameterBag::$parameters is assigned
    in vendor/ServerBag.php on line 77
  3. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  4. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  5. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  6. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  7. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  8. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  9. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  10. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  2. Path: Read from $_POST, and $_POST is passed to Request::createRequestFromFactory() in Request.php on line 314
  1. Read from $_POST, and $_POST is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  2. $request is passed to Request::__construct()
    in vendor/Request.php on line 2031
  3. $request is passed to Request::initialize()
    in vendor/Request.php on line 255
  4. $request is passed to ParameterBag::__construct()
    in vendor/Request.php on line 273
  5. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  6. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  7. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  8. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  9. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  10. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  11. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  12. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  13. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  3. Path: Read from $_SERVER, and $server is assigned in Request.php on line 304
  1. Read from $_SERVER, and $server is assigned
    in vendor/Request.php on line 304
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  4. Path: Fetching key HTTP_CONTENT_LENGTH from $_SERVER, and $server is assigned in Request.php on line 307
  1. Fetching key HTTP_CONTENT_LENGTH from $_SERVER, and $server is assigned
    in vendor/Request.php on line 307
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  5. Path: Fetching key HTTP_CONTENT_TYPE from $_SERVER, and $server is assigned in Request.php on line 310
  1. Fetching key HTTP_CONTENT_TYPE from $_SERVER, and $server is assigned
    in vendor/Request.php on line 310
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  6. Path: $server['HTTP_HOST'] seems to return tainted data, and $server is assigned in Request.php on line 380
  1. $server['HTTP_HOST'] seems to return tainted data, and $server is assigned
    in vendor/Request.php on line 380
  2. $server is assigned
    in vendor/Request.php on line 428
  3. $server is assigned
    in vendor/Request.php on line 429
  4. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 431
  5. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  6. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  7. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  8. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  9. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  10. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  11. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  12. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  13. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  14. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  15. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  16. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  7. Path: $this->parameters['PHP_AUTH_USER'] seems to return tainted data, and $headers is assigned in ServerBag.php on line 43
  1. $this->parameters['PHP_AUTH_USER'] seems to return tainted data, and $headers is assigned
    in vendor/ServerBag.php on line 43
  2. $headers is assigned
    in vendor/ServerBag.php on line 44
  3. ServerBag::getHeaders() returns tainted data, and $this->server->getHeaders() is passed to HeaderBag::__construct()
    in vendor/Request.php on line 279
  4. $values is assigned
    in vendor/HeaderBag.php on line 29
  5. $values is passed to HeaderBag::set()
    in vendor/HeaderBag.php on line 30
  6. (array) $values is passed through array_values(), and $values is assigned
    in vendor/HeaderBag.php on line 141
  7. HeaderBag::$headers is assigned
    in vendor/HeaderBag.php on line 144
  8. Tainted property HeaderBag::$headers is read
    in vendor/HeaderBag.php on line 65
  9. HeaderBag::all() returns tainted data, and $headers is assigned
    in vendor/HeaderBag.php on line 113
  10. HeaderBag::get() returns tainted data, and $requestUri is assigned
    in vendor/Request.php on line 1795
  11. $requestUri is passed to ParameterBag::set()
    in vendor/Request.php on line 1826
  12. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 95
  13. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  14. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  15. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  16. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  17. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  18. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  19. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  20. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  8. Path: $this->parameters['PHP_AUTH_PW'] seems to return tainted data, and $headers is assigned in ServerBag.php on line 44
  1. $this->parameters['PHP_AUTH_PW'] seems to return tainted data, and $headers is assigned
    in vendor/ServerBag.php on line 44
  2. ServerBag::getHeaders() returns tainted data, and $this->server->getHeaders() is passed to HeaderBag::__construct()
    in vendor/Request.php on line 279
  3. $values is assigned
    in vendor/HeaderBag.php on line 29
  4. $values is passed to HeaderBag::set()
    in vendor/HeaderBag.php on line 30
  5. (array) $values is passed through array_values(), and $values is assigned
    in vendor/HeaderBag.php on line 141
  6. HeaderBag::$headers is assigned
    in vendor/HeaderBag.php on line 144
  7. Tainted property HeaderBag::$headers is read
    in vendor/HeaderBag.php on line 65
  8. HeaderBag::all() returns tainted data, and $headers is assigned
    in vendor/HeaderBag.php on line 113
  9. HeaderBag::get() returns tainted data, and $requestUri is assigned
    in vendor/Request.php on line 1795
  10. $requestUri is passed to ParameterBag::set()
    in vendor/Request.php on line 1826
  11. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 95
  12. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  13. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  14. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  15. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  16. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  17. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  18. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  19. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  9. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 471
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 471
  2. $newged is assigned
    in edit_interface.php on line 491
  3. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  4. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  5. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  6. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  7. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  8. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  9. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  10. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  11. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  12. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  13. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  14. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  15. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  16. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  17. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  18. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  19. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  20. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  21. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  22. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  23. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  24. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  10. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 475
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 475
  2. $newged is assigned
    in edit_interface.php on line 491
  3. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  4. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  5. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  6. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  7. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  8. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  9. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  10. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  11. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  12. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  13. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  14. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  15. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  16. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  17. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  18. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  19. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  20. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  21. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  22. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  23. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  24. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135
  11. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 500
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 500
  2. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  3. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  4. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  5. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  6. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  7. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  8. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  9. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  10. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  11. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  12. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  13. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  14. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  15. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  16. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  17. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  18. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  19. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  20. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  21. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  22. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  23. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 135

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
136
					<?= $spouse === $individual ? '<b>' : '' ?>
137
					<?= $spouse->getFullName() ?> <?= $spouse->getLifeSpan() ?>
138
					<?= $spouse === $individual ? '</b>' : '' ?>
139
				</a>
140
			</td>
141
			<td>
142
				<?php if ($individual !== $spouse): ?>
143
					<a href="edit_interface.php?action=addmedia_links&amp;noteid=newnote&amp;pid=<?= $spouse->getXref() ?>&amp;gedcom=<?= $spouse->getTree()->getNameUrl() ?>">
0 ignored issues
show
Security Cross-Site Scripting introduced by
$spouse->getXref() can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

11 paths for user data to reach this point

  1. Path: $this->parameters['HTTP_AUTHORIZATION'] seems to return tainted data, and $authorizationHeader is assigned in ServerBag.php on line 62
  1. $this->parameters['HTTP_AUTHORIZATION'] seems to return tainted data, and $authorizationHeader is assigned
    in vendor/ServerBag.php on line 62
  2. ParameterBag::$parameters is assigned
    in vendor/ServerBag.php on line 77
  3. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  4. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  5. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  6. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  7. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  8. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  9. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  10. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  2. Path: Read from $_POST, and $_POST is passed to Request::createRequestFromFactory() in Request.php on line 314
  1. Read from $_POST, and $_POST is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  2. $request is passed to Request::__construct()
    in vendor/Request.php on line 2031
  3. $request is passed to Request::initialize()
    in vendor/Request.php on line 255
  4. $request is passed to ParameterBag::__construct()
    in vendor/Request.php on line 273
  5. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  6. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  7. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  8. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  9. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  10. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  11. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  12. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  13. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  3. Path: Read from $_SERVER, and $server is assigned in Request.php on line 304
  1. Read from $_SERVER, and $server is assigned
    in vendor/Request.php on line 304
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  4. Path: Fetching key HTTP_CONTENT_LENGTH from $_SERVER, and $server is assigned in Request.php on line 307
  1. Fetching key HTTP_CONTENT_LENGTH from $_SERVER, and $server is assigned
    in vendor/Request.php on line 307
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  5. Path: Fetching key HTTP_CONTENT_TYPE from $_SERVER, and $server is assigned in Request.php on line 310
  1. Fetching key HTTP_CONTENT_TYPE from $_SERVER, and $server is assigned
    in vendor/Request.php on line 310
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  6. Path: $server['HTTP_HOST'] seems to return tainted data, and $server is assigned in Request.php on line 380
  1. $server['HTTP_HOST'] seems to return tainted data, and $server is assigned
    in vendor/Request.php on line 380
  2. $server is assigned
    in vendor/Request.php on line 428
  3. $server is assigned
    in vendor/Request.php on line 429
  4. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 431
  5. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  6. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  7. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  8. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  9. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  10. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  11. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  12. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  13. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  14. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  15. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  16. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  7. Path: $this->parameters['PHP_AUTH_USER'] seems to return tainted data, and $headers is assigned in ServerBag.php on line 43
  1. $this->parameters['PHP_AUTH_USER'] seems to return tainted data, and $headers is assigned
    in vendor/ServerBag.php on line 43
  2. $headers is assigned
    in vendor/ServerBag.php on line 44
  3. ServerBag::getHeaders() returns tainted data, and $this->server->getHeaders() is passed to HeaderBag::__construct()
    in vendor/Request.php on line 279
  4. $values is assigned
    in vendor/HeaderBag.php on line 29
  5. $values is passed to HeaderBag::set()
    in vendor/HeaderBag.php on line 30
  6. (array) $values is passed through array_values(), and $values is assigned
    in vendor/HeaderBag.php on line 141
  7. HeaderBag::$headers is assigned
    in vendor/HeaderBag.php on line 144
  8. Tainted property HeaderBag::$headers is read
    in vendor/HeaderBag.php on line 65
  9. HeaderBag::all() returns tainted data, and $headers is assigned
    in vendor/HeaderBag.php on line 113
  10. HeaderBag::get() returns tainted data, and $requestUri is assigned
    in vendor/Request.php on line 1795
  11. $requestUri is passed to ParameterBag::set()
    in vendor/Request.php on line 1826
  12. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 95
  13. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  14. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  15. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  16. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  17. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  18. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  19. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  20. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  8. Path: $this->parameters['PHP_AUTH_PW'] seems to return tainted data, and $headers is assigned in ServerBag.php on line 44
  1. $this->parameters['PHP_AUTH_PW'] seems to return tainted data, and $headers is assigned
    in vendor/ServerBag.php on line 44
  2. ServerBag::getHeaders() returns tainted data, and $this->server->getHeaders() is passed to HeaderBag::__construct()
    in vendor/Request.php on line 279
  3. $values is assigned
    in vendor/HeaderBag.php on line 29
  4. $values is passed to HeaderBag::set()
    in vendor/HeaderBag.php on line 30
  5. (array) $values is passed through array_values(), and $values is assigned
    in vendor/HeaderBag.php on line 141
  6. HeaderBag::$headers is assigned
    in vendor/HeaderBag.php on line 144
  7. Tainted property HeaderBag::$headers is read
    in vendor/HeaderBag.php on line 65
  8. HeaderBag::all() returns tainted data, and $headers is assigned
    in vendor/HeaderBag.php on line 113
  9. HeaderBag::get() returns tainted data, and $requestUri is assigned
    in vendor/Request.php on line 1795
  10. $requestUri is passed to ParameterBag::set()
    in vendor/Request.php on line 1826
  11. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 95
  12. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  13. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  14. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  15. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  16. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  17. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  18. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  19. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  9. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 471
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 471
  2. $newged is assigned
    in edit_interface.php on line 491
  3. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  4. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  5. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  6. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  7. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  8. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  9. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  10. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  11. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  12. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  13. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  14. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  15. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  16. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  17. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  18. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  19. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  20. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  21. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  22. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  23. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  24. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  10. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 475
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 475
  2. $newged is assigned
    in edit_interface.php on line 491
  3. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  4. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  5. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  6. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  7. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  8. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  9. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  10. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  11. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  12. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  13. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  14. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  15. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  16. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  17. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  18. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  19. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  20. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  21. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  22. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  23. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  24. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143
  11. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 500
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 500
  2. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  3. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  4. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  5. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  6. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  7. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  8. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  9. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  10. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  11. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  12. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  13. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  14. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  15. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  16. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  17. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  18. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  19. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  20. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  21. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  22. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  23. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 143

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
144
						<i class="headimg vmiddle icon-button_head"></i>
145
					</a>
146
				<?php endif ?>
147
			</td>
148
		<tr>
149
	<?php
150
	}
151
152 View Code Duplication
	foreach ($family->getChildren() as $child) {
153
		?>
154
		<tr>
155
			<td>
156
				<a href="#" onclick="opener.insertRowToTable('<?= $child->getXref() ?>', '<?= Html::escape($child->getFullName()) ?>', '', '', '', '', '', '', '', ''); return false;">
0 ignored issues
show
Security Cross-Site Scripting introduced by
$child->getXref() can contain request data and is used in html attribute with single-quotes context(s) leading to a potential security vulnerability.

11 paths for user data to reach this point

  1. Path: $this->parameters['HTTP_AUTHORIZATION'] seems to return tainted data, and $authorizationHeader is assigned in ServerBag.php on line 62
  1. $this->parameters['HTTP_AUTHORIZATION'] seems to return tainted data, and $authorizationHeader is assigned
    in vendor/ServerBag.php on line 62
  2. ParameterBag::$parameters is assigned
    in vendor/ServerBag.php on line 77
  3. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  4. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  5. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  6. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  7. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  8. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  9. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  10. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  2. Path: Read from $_POST, and $_POST is passed to Request::createRequestFromFactory() in Request.php on line 314
  1. Read from $_POST, and $_POST is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  2. $request is passed to Request::__construct()
    in vendor/Request.php on line 2031
  3. $request is passed to Request::initialize()
    in vendor/Request.php on line 255
  4. $request is passed to ParameterBag::__construct()
    in vendor/Request.php on line 273
  5. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  6. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  7. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  8. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  9. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  10. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  11. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  12. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  13. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  3. Path: Read from $_SERVER, and $server is assigned in Request.php on line 304
  1. Read from $_SERVER, and $server is assigned
    in vendor/Request.php on line 304
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  4. Path: Fetching key HTTP_CONTENT_LENGTH from $_SERVER, and $server is assigned in Request.php on line 307
  1. Fetching key HTTP_CONTENT_LENGTH from $_SERVER, and $server is assigned
    in vendor/Request.php on line 307
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  5. Path: Fetching key HTTP_CONTENT_TYPE from $_SERVER, and $server is assigned in Request.php on line 310
  1. Fetching key HTTP_CONTENT_TYPE from $_SERVER, and $server is assigned
    in vendor/Request.php on line 310
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  6. Path: $server['HTTP_HOST'] seems to return tainted data, and $server is assigned in Request.php on line 380
  1. $server['HTTP_HOST'] seems to return tainted data, and $server is assigned
    in vendor/Request.php on line 380
  2. $server is assigned
    in vendor/Request.php on line 428
  3. $server is assigned
    in vendor/Request.php on line 429
  4. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 431
  5. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  6. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  7. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  8. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  9. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  10. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  11. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  12. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  13. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  14. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  15. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  16. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  7. Path: $this->parameters['PHP_AUTH_USER'] seems to return tainted data, and $headers is assigned in ServerBag.php on line 43
  1. $this->parameters['PHP_AUTH_USER'] seems to return tainted data, and $headers is assigned
    in vendor/ServerBag.php on line 43
  2. $headers is assigned
    in vendor/ServerBag.php on line 44
  3. ServerBag::getHeaders() returns tainted data, and $this->server->getHeaders() is passed to HeaderBag::__construct()
    in vendor/Request.php on line 279
  4. $values is assigned
    in vendor/HeaderBag.php on line 29
  5. $values is passed to HeaderBag::set()
    in vendor/HeaderBag.php on line 30
  6. (array) $values is passed through array_values(), and $values is assigned
    in vendor/HeaderBag.php on line 141
  7. HeaderBag::$headers is assigned
    in vendor/HeaderBag.php on line 144
  8. Tainted property HeaderBag::$headers is read
    in vendor/HeaderBag.php on line 65
  9. HeaderBag::all() returns tainted data, and $headers is assigned
    in vendor/HeaderBag.php on line 113
  10. HeaderBag::get() returns tainted data, and $requestUri is assigned
    in vendor/Request.php on line 1795
  11. $requestUri is passed to ParameterBag::set()
    in vendor/Request.php on line 1826
  12. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 95
  13. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  14. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  15. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  16. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  17. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  18. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  19. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  20. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  8. Path: $this->parameters['PHP_AUTH_PW'] seems to return tainted data, and $headers is assigned in ServerBag.php on line 44
  1. $this->parameters['PHP_AUTH_PW'] seems to return tainted data, and $headers is assigned
    in vendor/ServerBag.php on line 44
  2. ServerBag::getHeaders() returns tainted data, and $this->server->getHeaders() is passed to HeaderBag::__construct()
    in vendor/Request.php on line 279
  3. $values is assigned
    in vendor/HeaderBag.php on line 29
  4. $values is passed to HeaderBag::set()
    in vendor/HeaderBag.php on line 30
  5. (array) $values is passed through array_values(), and $values is assigned
    in vendor/HeaderBag.php on line 141
  6. HeaderBag::$headers is assigned
    in vendor/HeaderBag.php on line 144
  7. Tainted property HeaderBag::$headers is read
    in vendor/HeaderBag.php on line 65
  8. HeaderBag::all() returns tainted data, and $headers is assigned
    in vendor/HeaderBag.php on line 113
  9. HeaderBag::get() returns tainted data, and $requestUri is assigned
    in vendor/Request.php on line 1795
  10. $requestUri is passed to ParameterBag::set()
    in vendor/Request.php on line 1826
  11. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 95
  12. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  13. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  14. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  15. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  16. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  17. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  18. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  19. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  9. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 471
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 471
  2. $newged is assigned
    in edit_interface.php on line 491
  3. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  4. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  5. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  6. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  7. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  8. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  9. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  10. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  11. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  12. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  13. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  14. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  15. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  16. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  17. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  18. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  19. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  20. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  21. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  22. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  23. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  24. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  10. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 475
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 475
  2. $newged is assigned
    in edit_interface.php on line 491
  3. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  4. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  5. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  6. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  7. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  8. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  9. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  10. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  11. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  12. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  13. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  14. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  15. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  16. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  17. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  18. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  19. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  20. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  21. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  22. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  23. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  24. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156
  11. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 500
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 500
  2. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  3. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  4. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  5. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  6. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  7. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  8. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  9. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  10. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  11. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  12. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  13. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  14. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  15. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  16. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  17. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  18. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  19. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  20. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  21. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  22. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  23. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 156

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
157
					<?= $child === $individual ? '<b>' : '' ?>
158
					<?= $child->getFullName() ?> <?= $child->getLifeSpan() ?>
159
				<?= $child === $individual ? '</b>' : '' ?>
160
				</a>
161
			</td>
162
			<td>
163
			<?php if ($individual !== $child): ?>
164
					<a href="edit_interface.php?action=addmedia_links&amp;noteid=newnote&amp;pid=<?= $child->getXref() ?>&amp;gedcom=<?= $child->getTree()->getNameUrl() ?>">
0 ignored issues
show
Security Cross-Site Scripting introduced by
$child->getXref() can contain request data and is used in html attribute with double-quotes context(s) leading to a potential security vulnerability.

11 paths for user data to reach this point

  1. Path: $this->parameters['HTTP_AUTHORIZATION'] seems to return tainted data, and $authorizationHeader is assigned in ServerBag.php on line 62
  1. $this->parameters['HTTP_AUTHORIZATION'] seems to return tainted data, and $authorizationHeader is assigned
    in vendor/ServerBag.php on line 62
  2. ParameterBag::$parameters is assigned
    in vendor/ServerBag.php on line 77
  3. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  4. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  5. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  6. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  7. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  8. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  9. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  10. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  2. Path: Read from $_POST, and $_POST is passed to Request::createRequestFromFactory() in Request.php on line 314
  1. Read from $_POST, and $_POST is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  2. $request is passed to Request::__construct()
    in vendor/Request.php on line 2031
  3. $request is passed to Request::initialize()
    in vendor/Request.php on line 255
  4. $request is passed to ParameterBag::__construct()
    in vendor/Request.php on line 273
  5. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  6. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  7. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  8. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  9. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  10. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  11. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  12. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  13. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  3. Path: Read from $_SERVER, and $server is assigned in Request.php on line 304
  1. Read from $_SERVER, and $server is assigned
    in vendor/Request.php on line 304
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  4. Path: Fetching key HTTP_CONTENT_LENGTH from $_SERVER, and $server is assigned in Request.php on line 307
  1. Fetching key HTTP_CONTENT_LENGTH from $_SERVER, and $server is assigned
    in vendor/Request.php on line 307
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  5. Path: Fetching key HTTP_CONTENT_TYPE from $_SERVER, and $server is assigned in Request.php on line 310
  1. Fetching key HTTP_CONTENT_TYPE from $_SERVER, and $server is assigned
    in vendor/Request.php on line 310
  2. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 314
  3. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  4. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  5. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  6. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  7. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  8. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  9. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  10. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  11. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  12. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  13. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  14. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  6. Path: $server['HTTP_HOST'] seems to return tainted data, and $server is assigned in Request.php on line 380
  1. $server['HTTP_HOST'] seems to return tainted data, and $server is assigned
    in vendor/Request.php on line 380
  2. $server is assigned
    in vendor/Request.php on line 428
  3. $server is assigned
    in vendor/Request.php on line 429
  4. $server is passed to Request::createRequestFromFactory()
    in vendor/Request.php on line 431
  5. $server is passed to Request::__construct()
    in vendor/Request.php on line 2031
  6. $server is passed to Request::initialize()
    in vendor/Request.php on line 255
  7. $server is passed to ParameterBag::__construct()
    in vendor/Request.php on line 278
  8. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 31
  9. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  10. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  11. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  12. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  13. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  14. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  15. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  16. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  7. Path: $this->parameters['PHP_AUTH_USER'] seems to return tainted data, and $headers is assigned in ServerBag.php on line 43
  1. $this->parameters['PHP_AUTH_USER'] seems to return tainted data, and $headers is assigned
    in vendor/ServerBag.php on line 43
  2. $headers is assigned
    in vendor/ServerBag.php on line 44
  3. ServerBag::getHeaders() returns tainted data, and $this->server->getHeaders() is passed to HeaderBag::__construct()
    in vendor/Request.php on line 279
  4. $values is assigned
    in vendor/HeaderBag.php on line 29
  5. $values is passed to HeaderBag::set()
    in vendor/HeaderBag.php on line 30
  6. (array) $values is passed through array_values(), and $values is assigned
    in vendor/HeaderBag.php on line 141
  7. HeaderBag::$headers is assigned
    in vendor/HeaderBag.php on line 144
  8. Tainted property HeaderBag::$headers is read
    in vendor/HeaderBag.php on line 65
  9. HeaderBag::all() returns tainted data, and $headers is assigned
    in vendor/HeaderBag.php on line 113
  10. HeaderBag::get() returns tainted data, and $requestUri is assigned
    in vendor/Request.php on line 1795
  11. $requestUri is passed to ParameterBag::set()
    in vendor/Request.php on line 1826
  12. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 95
  13. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  14. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  15. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  16. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  17. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  18. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  19. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  20. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  8. Path: $this->parameters['PHP_AUTH_PW'] seems to return tainted data, and $headers is assigned in ServerBag.php on line 44
  1. $this->parameters['PHP_AUTH_PW'] seems to return tainted data, and $headers is assigned
    in vendor/ServerBag.php on line 44
  2. ServerBag::getHeaders() returns tainted data, and $this->server->getHeaders() is passed to HeaderBag::__construct()
    in vendor/Request.php on line 279
  3. $values is assigned
    in vendor/HeaderBag.php on line 29
  4. $values is passed to HeaderBag::set()
    in vendor/HeaderBag.php on line 30
  5. (array) $values is passed through array_values(), and $values is assigned
    in vendor/HeaderBag.php on line 141
  6. HeaderBag::$headers is assigned
    in vendor/HeaderBag.php on line 144
  7. Tainted property HeaderBag::$headers is read
    in vendor/HeaderBag.php on line 65
  8. HeaderBag::all() returns tainted data, and $headers is assigned
    in vendor/HeaderBag.php on line 113
  9. HeaderBag::get() returns tainted data, and $requestUri is assigned
    in vendor/Request.php on line 1795
  10. $requestUri is passed to ParameterBag::set()
    in vendor/Request.php on line 1826
  11. ParameterBag::$parameters is assigned
    in vendor/ParameterBag.php on line 95
  12. Tainted property ParameterBag::$parameters is read
    in vendor/ParameterBag.php on line 84
  13. ParameterBag::get() returns tainted data, and $result is assigned
    in vendor/Request.php on line 805
  14. Request::get() returns tainted data, and $indi_xref is assigned
    in app/Http/Controllers/AdminController.php on line 896
  15. $indi_xref is passed to GedcomRecord::getInstance()
    in app/Http/Controllers/AdminController.php on line 902
  16. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  17. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  18. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  19. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  9. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 471
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 471
  2. $newged is assigned
    in edit_interface.php on line 491
  3. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  4. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  5. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  6. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  7. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  8. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  9. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  10. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  11. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  12. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  13. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  14. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  15. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  16. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  17. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  18. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  19. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  20. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  21. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  22. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  23. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  24. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  10. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 475
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 475
  2. $newged is assigned
    in edit_interface.php on line 491
  3. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  4. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  5. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  6. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  7. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  8. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  9. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  10. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  11. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  12. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  13. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  14. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  15. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  16. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  17. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  18. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  19. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  20. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  21. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  22. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  23. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  24. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164
  11. Path: Read from $_POST, and $newged is assigned in edit_interface.php on line 500
  1. Read from $_POST, and $newged is assigned
    in edit_interface.php on line 500
  2. $newged is passed through substr(), and $newged is assigned
    in edit_interface.php on line 505
  3. $newged is passed to GedcomRecord::updateFact()
    in edit_interface.php on line 513
  4. $gedcom is passed through preg_replace(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1191
  5. $gedcom is passed through trim(), and $gedcom is assigned
    in app/GedcomRecord.php on line 1192
  6. $new_gedcom is assigned
    in app/GedcomRecord.php on line 1229
  7. GedcomRecord::$gedcom is assigned
    in app/GedcomRecord.php on line 1248
  8. Tainted property GedcomRecord::$gedcom is read
    in app/GedcomRecord.php on line 494
  9. GedcomRecord::privatizeGedcom() returns tainted data, and $newgedrec is assigned
    in app/Report/ReportParserGenerate.php on line 594
  10. ReportParserGenerate::$gedrec is assigned
    in app/Report/ReportParserGenerate.php on line 618
  11. Tainted property ReportParserGenerate::$gedrec is read
    in app/Report/ReportParserGenerate.php on line 1261
  12. Data is passed through explode()
    in vendor/app/Functions/Functions.php on line 174
  13. $thisSubrecord is assigned
    in vendor/app/Functions/Functions.php on line 175
  14. Data is passed through substr()
    in vendor/app/Functions/Functions.php on line 181
  15. ReportParserGenerate::$desc is assigned
    in app/Report/ReportParserGenerate.php on line 1261
  16. Tainted property ReportParserGenerate::$desc is read, and $value is assigned
    in app/Report/ReportParserGenerate.php on line 1307
  17. ReportParserGenerate::$vars is assigned
    in app/Report/ReportParserGenerate.php on line 1357
  18. Tainted property ReportParserGenerate::$vars is read, and $id is assigned
    in app/Report/ReportParserGenerate.php on line 827
  19. $id is passed to GedcomRecord::getInstance()
    in app/Report/ReportParserGenerate.php on line 841
  20. $xref is passed to GedcomRecord::__construct()
    in app/GedcomRecord.php on line 202
  21. GedcomRecord::$xref is assigned
    in app/GedcomRecord.php on line 79
  22. Tainted property GedcomRecord::$xref is read
    in app/GedcomRecord.php on line 280
  23. GedcomRecord::getXref() returns tainted data
    in modules_v3/GEDFact_assistant/MEDIA_ctrl.php on line 164

Preventing Cross-Site-Scripting Attacks

Cross-Site-Scripting allows an attacker to inject malicious code into your website - in particular Javascript code, and have that code executed with the privileges of a visiting user. This can be used to obtain data, or perform actions on behalf of that visiting user.

In order to prevent this, make sure to escape all user-provided data:

// for HTML
$sanitized = htmlentities($tainted, ENT_QUOTES);

// for URLs
$sanitized = urlencode($tainted);

General Strategies to prevent injection

In general, it is advisable to prevent any user-data to reach this point. This can be done by white-listing certain values:

if ( ! in_array($value, array('this-is-allowed', 'and-this-too'), true)) {
    throw new \InvalidArgumentException('This input is not allowed.');
}

For numeric data, we recommend to explicitly cast the data:

$sanitized = (integer) $tainted;
Loading history...
165
						<i class="headimg vmiddle icon-button_head"></i>
166
					</a>
167
				<?php endif ?>
168
			</td>
169
		</tr>
170
	<?php
171
	}
172
}
173