File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 55 */
66namespace Embed \RequestResolvers ;
77
8+ use Embed \Exceptions \EmbedException ;
9+
810class Curl implements RequestResolverInterface
911{
1012 protected static $ tmpCookies ;
@@ -113,6 +115,14 @@ protected function resolve()
113115
114116 if (!self ::$ tmpCookies ) {
115117 self ::$ tmpCookies = str_replace ('// ' , '/ ' , sys_get_temp_dir ().'/embed-cookies.txt ' );
118+
119+ if (is_file (self ::$ tmpCookies )) {
120+ if (!is_writable (self ::$ tmpCookies )) {
121+ throw new EmbedException (sprintf ('The temporary cookies file "%s" is not writable ' , self ::$ tmpCookies ));
122+ }
123+ } elseif (!is_writable (dirname (self ::$ tmpCookies ))) {
124+ throw new EmbedException (sprintf ('The temporary folder "%s" is not writable ' , dirname (self ::$ tmpCookies )));
125+ }
116126 }
117127
118128 $ connection = curl_init ();
You can’t perform that action at this time.
0 commit comments