diff options
author | Juha Sippola <juhasippola@ovi.com> | 2013-09-16 15:20:56 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-27 13:29:01 +0200 |
commit | 0cadb139f4093c44040f6e622bb60b48c011aa2e (patch) | |
tree | 409127188a5eb9a7bac8a85b501e43381ce6833d | |
parent | b63be9ad116a39ac2ff09455ee62776a47be77aa (diff) |
Qt metrics v1.5: URL encoding
Ajax Get method cannot pass special characters like plus sign in the URL.
Previously a character manipulation solution used, now replaced with a
proper PHP and JavaScript function calls. This is pure implementation
issue and is not visible to the user.
Change-Id: Idabd1dddd82a161b4695a8b234c2a055d77ab2f7
Reviewed-by: Tony SarajΓ€rvi <tony.sarajarvi@digia.com>
-rw-r--r-- | non-puppet/qtmetrics/ajaxrequest.js | 3 | ||||
-rw-r--r-- | non-puppet/qtmetrics/ci/showautotestdashboard.php | 6 | ||||
-rw-r--r-- | non-puppet/qtmetrics/ci/showprojectdashboard.php | 3 | ||||
-rw-r--r-- | non-puppet/qtmetrics/footer.php | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/non-puppet/qtmetrics/ajaxrequest.js b/non-puppet/qtmetrics/ajaxrequest.js index 6427abd..ac82fd4 100644 --- a/non-puppet/qtmetrics/ajaxrequest.js +++ b/non-puppet/qtmetrics/ajaxrequest.js @@ -70,6 +70,9 @@ function getMetricData(metricId, filepath, project, conf, autotest, timescaleTyp } if (typeof sortBy == "undefined") // sortBy is optional, set 0 as a default var sortBy = 0; + project = encodeURIComponent(project); // Encode the parameters to follow correct URL encoding (e.g. possible "+" characters) + conf = encodeURIComponent(conf); // -,,- + autotest = encodeURIComponent(autotest); // -,,- createMetricRequestObject(metricId); metricRequest[metricId].open("GET",filepath+"?project="+project+"&conf="+conf+"&autotest="+autotest+"&tstype=" +timescaleType+"&tsvalue="+timescaleValue+"&sort="+sortBy,true); diff --git a/non-puppet/qtmetrics/ci/showautotestdashboard.php b/non-puppet/qtmetrics/ci/showautotestdashboard.php index 86fdf3d..e323f5a 100644 --- a/non-puppet/qtmetrics/ci/showautotestdashboard.php +++ b/non-puppet/qtmetrics/ci/showautotestdashboard.php @@ -51,11 +51,11 @@ include "functions.php"; $timeStart = microtime(true); $timeProjectDuration = 0; $project = $_GET["project"]; +$project = rawurldecode($project); // Decode the encoded parameter (encoding in ajaxrequest.js) $conf = $_GET["conf"]; -// Problem: Parameter passing (with GET method in URL) destroys the string "++", e.g. "linux-g++-32_Ubuntu_10.04_x86" -> "linux-g -32_Ubuntu_10.04_x86" -// -> parameter is here 'returned' to its original value -$conf = str_replace("g ","g++",$conf); +$conf = rawurldecode($conf); // Decode the encoded parameter (encoding in ajaxrequest.js) $autotest = $_GET["autotest"]; +$autotest = rawurldecode($autotest); // Decode the encoded parameter (encoding in ajaxrequest.js) $timescaleType = $_GET["tstype"]; $timescaleValue = $_GET["tsvalue"]; $sortBy = $_GET["sort"]; diff --git a/non-puppet/qtmetrics/ci/showprojectdashboard.php b/non-puppet/qtmetrics/ci/showprojectdashboard.php index 0f71243..f38e8f0 100644 --- a/non-puppet/qtmetrics/ci/showprojectdashboard.php +++ b/non-puppet/qtmetrics/ci/showprojectdashboard.php @@ -50,8 +50,9 @@ include "functions.php"; $timeStart = microtime(true); $project = $_GET["project"]; +$project = rawurldecode($project); // Decode the encoded parameter (encoding in ajaxrequest.js) $conf = $_GET["conf"]; -$conf = str_replace("g ","g++",$conf); // Problem: Parameter passing (with GET method in URL) destroys the string "++", e.g. "linux-g++-32_Ubuntu_10.04_x86" -> "linux-g -32_Ubuntu_10.04_x86" +$conf = rawurldecode($conf); // Decode the encoded parameter (encoding in ajaxrequest.js) $timescaleType = $_GET["tstype"]; $timescaleValue = $_GET["tsvalue"]; diff --git a/non-puppet/qtmetrics/footer.php b/non-puppet/qtmetrics/footer.php index f444cee..1158ee2 100644 --- a/non-puppet/qtmetrics/footer.php +++ b/non-puppet/qtmetrics/footer.php @@ -42,7 +42,7 @@ ?> <div id="footer"> -<b>Report builder v1.4.1 13-Sep-2013</b><br/> +<b>Report builder v1.5 13-Sep-2013</b><br/> Description, guidance and support:<br/> <a href="http://qt-project.org/wiki/Qt_Metrics_Page_Description" target="_blank">http://qt-project.org/wiki/Qt_Metrics_Page_Description</a> </div> |