Skip to content

Commit 1f5bbf9

Browse files
committed
use echo instead of print_r on strings
print_r is useful for structures, for strings use echo this commit makes no changes to actual output.
1 parent ef9eb68 commit 1f5bbf9

5 files changed

Lines changed: 14 additions & 17 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ unset($_SESSION['AuthNRequestID']);
726726
$errors = $auth->getErrors();
727727

728728
if (!empty($errors)) {
729-
print_r('<p>'.implode(', ', $errors).'</p>');
729+
echo '<p>', implode(', ', $errors), '</p>';
730730
exit();
731731
}
732732

@@ -865,9 +865,9 @@ $auth->processSLO(false, $requestID);
865865
$errors = $auth->getErrors();
866866

867867
if (empty($errors)) {
868-
print_r('Sucessfully logged out');
868+
echo 'Sucessfully logged out';
869869
} else {
870-
print_r(implode(', ', $errors));
870+
echo implode(', ', $errors);
871871
}
872872
```
873873

@@ -1058,7 +1058,7 @@ if (isset($_GET['sso'])) { // SSO action. Will send an AuthNRequest to the I
10581058
// that could took place during the process
10591059

10601060
if (!empty($errors)) {
1061-
print_r('<p>'.implode(', ', $errors).'</p>');
1061+
echo '<p>', implode(', ', $errors), '</p>';
10621062
}
10631063
// This check if the response was
10641064
if (!$auth->isAuthenticated()) { // sucessfully validated and the user
@@ -1074,9 +1074,9 @@ if (isset($_GET['sso'])) { // SSO action. Will send an AuthNRequest to the I
10741074
$auth->processSLO(); // Process the Logout Request & Logout Response
10751075
$errors = $auth->getErrors(); // Retrieves possible validation errors
10761076
if (empty($errors)) {
1077-
print_r('<p>Sucessfully logged out</p>');
1077+
echo '<p>Sucessfully logged out</p>';
10781078
} else {
1079-
print_r('<p>'.implode(', ', $errors).'</p>');
1079+
echo '<p>', implode(', ', $errors), '</p>';
10801080
}
10811081
}
10821082

demo1/index.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
/**
43
* SAML Handler
54
*/
@@ -65,7 +64,7 @@
6564
$errors = $auth->getErrors();
6665

6766
if (!empty($errors)) {
68-
print_r('<p>'.implode(', ', $errors).'</p>');
67+
echo '<p>',implode(', ', $errors),'</p>';
6968
}
7069

7170
if (!$auth->isAuthenticated()) {
@@ -91,9 +90,9 @@
9190
$auth->processSLO(false, $requestID);
9291
$errors = $auth->getErrors();
9392
if (empty($errors)) {
94-
print_r('<p>Sucessfully logged out</p>');
93+
echo '<p>Sucessfully logged out</p>';
9594
} else {
96-
print_r('<p>'.implode(', ', $errors).'</p>');
95+
echo '<p>', implode(', ', $errors), '</p>');
9796
}
9897
}
9998

endpoints/acs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
2+
33
/**
44
* SP Assertion Consumer Service Endpoint
55
*/
@@ -15,7 +15,7 @@
1515
$errors = $auth->getErrors();
1616

1717
if (!empty($errors)) {
18-
print_r('<p>'.implode(', ', $errors).'</p>');
18+
echo '<p>', implode(', ', $errors), '</p>';
1919
exit();
2020
}
2121

endpoints/sls.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
/**
43
* SP Single Logout Service Endpoint
54
*/
@@ -15,7 +14,7 @@
1514
$errors = $auth->getErrors();
1615

1716
if (empty($errors)) {
18-
print_r('Sucessfully logged out');
17+
echo 'Sucessfully logged out';
1918
} else {
20-
print_r(implode(', ', $errors));
19+
echo implode(', ', $errors);
2120
}

lib/Saml2/Utils.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
2+
33
/**
44
* Utils of OneLogin PHP Toolkit
55
*
@@ -260,7 +260,6 @@ public static function redirect($url, $parameters = array(), $stay = false)
260260
);
261261
}
262262

263-
264263
/* Add encoded parameters */
265264
if (strpos($url, '?') === false) {
266265
$paramPrefix = '?';

0 commit comments

Comments
 (0)