Skip to content

Commit 1427a4e

Browse files
authored
Merge pull request #34 from moufmouf/false_positives
Removing false positives
2 parents 0fe27e0 + f3ccd04 commit 1427a4e

File tree

6 files changed

+19
-69
lines changed

6 files changed

+19
-69
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ before_script:
2323
else
2424
cd generator/doc/doc-en
2525
svn update
26+
if [ $? -ne 0 ];
27+
then
28+
cd ..
29+
rm -rf doc-en
30+
svn co https://svn.php.net/repository/phpdoc/modules/doc-en doc-en
31+
cd doc-en
32+
fi
2633
cd ../../..
2734
fi
2835
- composer update

CONTRIBUTING.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Safe-PHP code is generated automatically from the PHP doc.
44

5-
## How to generate Safe-PHP code
5+
## How to install Safe-PHP development environment
66

77
The first step is to download the PHP documentation project locally.
88
You will need Subversion (svn) installed on your computer.
@@ -20,7 +20,6 @@ $ cd generator/doc/doc-en
2020
$ svn update
2121
```
2222

23-
2423
### Generating the functions
2524

2625
Generating the functions can be done with a simple command.
@@ -29,3 +28,11 @@ Generating the functions can be done with a simple command.
2928
$ cd generator
3029
$ php ./safe.php generate
3130
```
31+
32+
### Submitting a PR
33+
34+
The continuous integration hooks will regenerate all the functions and check that the result is exactly what has been
35+
committed. Therefore, before submitting a PR, please:
36+
37+
- Perform a "svn update"
38+
- Regenerate the files using `php ./safe.php generate`

generated/filesystem.php

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -877,53 +877,6 @@ function glob(string $pattern, int $flags = 0): array
877877
}
878878

879879

880-
/**
881-
* Tells whether the filename is executable.
882-
*
883-
* @param string $filename Path to the file.
884-
* @throws FilesystemException
885-
*
886-
*/
887-
function is_executable(string $filename): void
888-
{
889-
error_clear_last();
890-
$result = \is_executable($filename);
891-
if ($result === false) {
892-
throw FilesystemException::createFromPhpError();
893-
}
894-
}
895-
896-
897-
/**
898-
* Returns TRUE if the file named by filename was
899-
* uploaded via HTTP POST. This is useful to help ensure that a
900-
* malicious user hasn't tried to trick the script into working on
901-
* files upon which it should not be working--for instance,
902-
* /etc/passwd.
903-
*
904-
* This sort of check is especially important if there is any chance
905-
* that anything done with uploaded files could reveal their
906-
* contents to the user, or even to other users on the same
907-
* system.
908-
*
909-
* For proper working, the function is_uploaded_file needs
910-
* an argument like $_FILES['userfile']['tmp_name'], - the name of the uploaded
911-
* file on the client's machine $_FILES['userfile']['name'] does not work.
912-
*
913-
* @param string $filename The filename being checked.
914-
* @throws FilesystemException
915-
*
916-
*/
917-
function is_uploaded_file(string $filename): void
918-
{
919-
error_clear_last();
920-
$result = \is_uploaded_file($filename);
921-
if ($result === false) {
922-
throw FilesystemException::createFromPhpError();
923-
}
924-
}
925-
926-
927880
/**
928881
* Attempts to change the group of the symlink filename
929882
* to group.

generated/functionsList.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@
145145
'ftruncate',
146146
'fwrite',
147147
'glob',
148-
'is_executable',
149-
'is_uploaded_file',
150148
'lchgrp',
151149
'lchown',
152150
'link',
@@ -907,7 +905,6 @@
907905
'stream_filter_register',
908906
'stream_filter_remove',
909907
'stream_get_contents',
910-
'stream_is_local',
911908
'stream_isatty',
912909
'stream_resolve_include_path',
913910
'stream_set_blocking',

generated/stream.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -225,23 +225,6 @@ function stream_get_contents($handle, int $maxlength = -1, int $offset = -1): st
225225
}
226226

227227

228-
/**
229-
* Checks if a stream, or a URL, is a local one or not.
230-
*
231-
* @param mixed $stream_or_url The stream resource or URL to check.
232-
* @throws StreamException
233-
*
234-
*/
235-
function stream_is_local($stream_or_url): void
236-
{
237-
error_clear_last();
238-
$result = \stream_is_local($stream_or_url);
239-
if ($result === false) {
240-
throw StreamException::createFromPhpError();
241-
}
242-
}
243-
244-
245228
/**
246229
* Determines if stream stream refers to a valid terminal type device.
247230
* This is a more portable version of posix_isatty, since it works on Windows systems too.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
22
return [
33
'array_key_exists',
4+
'is_executable',
5+
'is_uploaded_file',
6+
'stream_is_local',
47
];

0 commit comments

Comments
 (0)