# ext/curl safe_upload is changed

- Thread: https://externals.io/message/74077
- Original archive: https://news-web.php.net/php.internals/74077
- Started by Laruence on 2014-05-09T05:47:45+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #74077 — Laruence — 2014-05-09T05:47:45+00:00

URL: https://externals.io/message/74077#74077

Hey Stas:

     I noticed that this change : https://github.com/php/php-src/commit/24447dca

     it has broken some tests  in ext/curl...  did you run make test before?

     Anyway,  the current behavior is silent return if the codes uses
old upload style("@filename");

     I think it's better to throw a warning or something error about that....

     thoughts?

thanks

-- 
Laruence  Xinchen Hui
http://www.laruence.com/

---

## #74082 — Stas Malyshev — 2014-05-09T06:52:35+00:00

URL: https://externals.io/message/74077#74082 · In reply to: #74077

Hi!

>      I noticed that this change : https://github.com/php/php-src/commit/24447dca
> 
>      it has broken some tests  in ext/curl...  did you run make test before?

Which tests? AFAIK the tests on Travis include curl, and they are green.

>      Anyway,  the current behavior is silent return if the codes uses
> old upload style("@filename");

What you mean by silent return? If unsafe upload is not turned on,
@filename is just a variable like any other.

>      I think it's better to throw a warning or something error about that....

I don't think so. "@filename" is a string like any others, there's no
reason to throw warnings on legitimate upload values.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

---

## #74084 — Laruence — 2014-05-09T06:54:17+00:00

URL: https://externals.io/message/74077#74084 · In reply to: #74082

> Hi!
>
> > […]
>
> Which tests? AFAIK the tests on Travis include curl, and they are green.
$ cat ext/curl/tests/bug27023.diff
001+ string(0) ""
002+ string(0) ""
003+ string(0) ""
004+ string(0) ""
005+ string(0) ""
001- string(%d) "curl_testdata1.txt|application/octet-stream"
002- string(%d) "curl_testdata1.txt|text/plain"
003- string(%d) "foo.txt|application/octet-stream"
004- string(%d) "foo.txt|text/plain"
005- string(%d) "foo.txt|text/plain"

thanks
>
> > […]
>
> What you mean by silent return? If unsafe upload is not turned on,
> @filename is just a variable like any other.
>
> > […]
>
> I don't think so. "@filename" is a string like any others, there's no
> reason to throw warnings on legitimate upload values.
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

---

## #74085 — Stas Malyshev — 2014-05-09T07:06:48+00:00

URL: https://externals.io/message/74077#74085 · In reply to: #74084

Hi!

> > […]
> $ cat ext/curl/tests/bug27023.diff

Ahh, this test requires special configuration. It'd be better to rewrite
it to supply its own server and not to have to set up special server for
it. But it needs either:
curl_setopt($ch, CURLOPT_SAFE_UPLOAD, 0);
or, even better, to be rewritten with new safe API in mind. Preferably
the latter. I'll look into it on the weekend if nobody beats me to it.

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
