This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 243912 - standard.php function image_type_to_extension wrong default
Summary: standard.php function image_type_to_extension wrong default
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-18 11:56 UTC by paolosca
Modified: 2015-05-20 02:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paolosca 2014-04-18 11:56:03 UTC
In the image_type_to_extension function the second parameter's default is '&true;' which is a string while it should be bool true. Line 950 is:

function image_type_to_extension ($imagetype, $include_dot = '&true;') {}

I believe it should be:

function image_type_to_extension ($imagetype, $include_dot = true) {}
 
As correctly stated in the functions' help:

/**
 * (PHP 5)<br/>
 * Get file extension for image type
 * @link http://php.net/manual/en/function.image-type-to-extension.php
 * @param int $imagetype <p>
 * One of the IMAGETYPE_XXX constant.
 * </p>
 * @param bool $include_dot [optional] <p>
 * Whether to prepend a dot to the extension or not. Default to <b>TRUE</b>.
 * </p>
 * @return string A string with the extension corresponding to the given image type.
 */

Regards,

Paolo
Comment 1 Ondrej Brejla 2014-04-25 07:19:26 UTC
Seems to be a problem of generated sig files.
Comment 2 Tomas Mysik 2014-04-25 07:21:24 UTC
Likely problem in PHP docs sources, we will regenerate signature files (for the next release).

Thanks.
Comment 3 Tomas Mysik 2014-04-25 07:58:57 UTC
Not a P3 IMHO.
Comment 4 Tomas Mysik 2015-05-19 12:13:10 UTC
I have discovered more issues in the default parameter values - these should be fixed now. Please verify, thanks.

http://hg.netbeans.org/web-main/rev/a7996864f8d9
Comment 5 Quality Engineering 2015-05-20 02:10:36 UTC
Integrated into 'main-silver', will be available in build *201505200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a7996864f8d9
User: Tomas Mysik <tmysik@netbeans.org>
Log: #243912 - standard.php function image_type_to_extension wrong default