← All changes
|
includes/admin/Destination/Google/google-api-php-client/src/cache/Google_FileCache.php
+4
-2
6.10
→
7.4
View file →
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | +// phpcs:ignoreFile -- third party library | |
| 2 | 3 | /* |
| 3 | 4 | * Copyright 2008 Google Inc. |
| 4 | 5 | * |
| 5 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| @@ -40,12 +41,13 @@ | ||
| 40 | 41 | private function createLock($storageFile) { |
| 41 | 42 | $storageDir = dirname($storageFile); |
| 42 | 43 | if (! is_dir($storageDir)) { |
| 43 | 44 | // @codeCoverageIgnoreStart |
| 45 | + //phpcs:ignore | |
| 44 | 46 | if (! @mkdir($storageDir, 0755, true)) { |
| 45 | 47 | // make sure the failure isn't because of a concurrency issue |
| 46 | 48 | if (! is_dir($storageDir)) { |
| 47 | - throw new Google_CacheException("Could not create storage directory: $storageDir"); | |
| 49 | + throw new Google_CacheException("Could not create storage directory: ".esc_html($storageDir)); | |
| 48 | 50 | } |
| 49 | 51 | } |
| 50 | 52 | // @codeCoverageIgnoreEnd |
| 51 | 53 | } |
| @@ -113,9 +115,9 @@ | ||
| 113 | 115 | $this->waitForLock($storageFile); |
| 114 | 116 | } |
| 115 | 117 | if (! is_dir($storageDir)) { |
| 116 | 118 | if (! @mkdir($storageDir, 0755, true)) { |
| 117 | - throw new Google_CacheException("Could not create storage directory: $storageDir"); | |
| 119 | + throw new Google_CacheException("Could not create storage directory: ".esc_html($storageDir)); | |
| 118 | 120 | } |
| 119 | 121 | } |
| 120 | 122 | // we serialize the whole request object, since we don't only want the |
| 121 | 123 | // responseContent but also the postBody used, headers, size, etc |