better handle of single quote to avoid code injectio in php

This commit is contained in:
wing328
2016-06-28 00:54:06 +08:00
parent 1638adb79e
commit ebd6ffaa4c
44 changed files with 187 additions and 169 deletions

View File

@@ -11,12 +11,12 @@
*/
/**
* Swagger Petstore =end
* Swagger Petstore ' \" =end
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 =end
* Contact: apiteam@swagger.io =end
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,7 +73,7 @@ class FakeApi
{
if ($apiClient == null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('https://petstore.swagger.io */ =end/v2 */ =end');
$apiClient->getConfig()->setHost('https://petstore.swagger.io */ ' " =end/v2 */ ' " =end');
}
$this->apiClient = $apiClient;
@@ -138,7 +138,7 @@ class FakeApi
if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept;
}
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','*/ =end'));
$headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','*/ =end));(phpinfo('));
// default format to json
$resourcePath = str_replace("{format}", "json", $resourcePath);

View File

@@ -11,12 +11,12 @@
*/
/**
* Swagger Petstore =end
* Swagger Petstore ' \" =end
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 =end
* Contact: apiteam@swagger.io =end
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,7 +73,7 @@ class PetApi
{
if ($apiClient == null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('https://petstore.swagger.io */ =end/v2 */ =end');
$apiClient->getConfig()->setHost('https://petstore.swagger.io */ ' " =end/v2 */ ' " =end');
}
$this->apiClient = $apiClient;

View File

@@ -11,12 +11,12 @@
*/
/**
* Swagger Petstore =end
* Swagger Petstore ' \" =end
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 =end
* Contact: apiteam@swagger.io =end
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,7 +73,7 @@ class StoreApi
{
if ($apiClient == null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('https://petstore.swagger.io */ =end/v2 */ =end');
$apiClient->getConfig()->setHost('https://petstore.swagger.io */ ' " =end/v2 */ ' " =end');
}
$this->apiClient = $apiClient;

View File

@@ -11,12 +11,12 @@
*/
/**
* Swagger Petstore =end
* Swagger Petstore ' \" =end
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ =end
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end
*
* OpenAPI spec version: 1.0.0 =end
* Contact: apiteam@swagger.io =end
* OpenAPI spec version: 1.0.0 ' \" =end
* Contact: apiteam@swagger.io ' \" =end
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -73,7 +73,7 @@ class UserApi
{
if ($apiClient == null) {
$apiClient = new ApiClient();
$apiClient->getConfig()->setHost('https://petstore.swagger.io */ =end/v2 */ =end');
$apiClient->getConfig()->setHost('https://petstore.swagger.io */ ' " =end/v2 */ ' " =end');
}
$this->apiClient = $apiClient;