Skip to content
Snippets Groups Projects
Unverified Commit bd528a00 authored by Pavel Vyskočil's avatar Pavel Vyskočil Committed by GitHub
Browse files

Merge pull request #4 from BaranekD/apostrophes_bug

DB commands work with apostrophes in names
parents e4e7609c 95378902
Branches
Tags
No related merge requests found
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
[Changed]
- DB commands work for apostrophe in IdP/SP names
## [v1.3.0] ## [v1.3.0]
[Added] [Added]
......
...@@ -84,7 +84,7 @@ class DatabaseCommand ...@@ -84,7 +84,7 @@ class DatabaseCommand
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".$row["idPName"]."', {v:".$row["count"]."}],"; echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".str_replace("'","\'",$row["idPName"])."', {v:".$row["count"]."}],";
} }
$conn->close(); $conn->close();
} }
...@@ -100,7 +100,8 @@ class DatabaseCommand ...@@ -100,7 +100,8 @@ class DatabaseCommand
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".$row["spName"]."', {v:".$row["count"]."}],"; } echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".str_replace("'","\'",$row["spName"])."', {v:".$row["count"]."}],";
}
$conn->close(); $conn->close();
} }
...@@ -158,7 +159,7 @@ class DatabaseCommand ...@@ -158,7 +159,7 @@ class DatabaseCommand
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
echo "['".$row["spName"]."', ".$row["count"]."],"; echo "['" . str_replace("'", "\'", $row["spName"]) . "', " . $row["count"] . "],";
} }
$conn->close(); $conn->close();
} }
...@@ -174,7 +175,7 @@ class DatabaseCommand ...@@ -174,7 +175,7 @@ class DatabaseCommand
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
echo "['".$row["idPName"]."', ".$row["count"]."],"; echo "['" . str_replace("'", "\'", $row["idPName"]) . "', " . $row["count"] . "],";
} }
$conn->close(); $conn->close();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment