View Issue Details

IDProjectCategoryView StatusLast Update
0010976mantisbtbugtrackerpublic2014-12-08 00:34
ReporterdhxAssigned Todregad 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0010976: Remove instances of pass-by-reference (deprecated in PHP 5.3.0)
Description

Passing by reference is not required in PHP because the interpreter uses copy-on-write. Additionally, as of PHP 5.3.0, passing by reference in functions is deprecated. See http://us2.php.net/manual/en/language.references.pass.php

Matches with grep -RnP '&\$' *

admin/install.php:304: $result = &$g_db->execute( 'set schema ' . $f_db_schema );
admin/install.php:330: $result = &$g_db->execute( 'set schema ' . $f_db_schema );
admin/install.php:564: $t_result = &$g_db->execute( 'set schema ' . $f_db_schema );
admin/install.php:581: $rs = &$g_db->Execute( "CREATE SCHEMA " . $f_db_schema );
admin/install.php:656: $result = &$g_db->execute( 'set schema ' . $f_db_schema );
admin/install.php:702: $result = &$g_db->execute( 'set schema ' . $f_db_schema );
admin/install.php:921: $result = &$g_db->execute( 'set schema ' . $f_db_schema );
api/soap/mc_issue_api.php:117:function mci_issue_set_custom_fields( $p_issue_id, &$p_custom_fields ) {
core/tag_api.php:104:function tag_name_is_valid( $p_name, &$p_matches, $p_prefix = '' ) {
core/ldap_api.php:200: $t_search_filter = "(&$t_ldap_organization($t_ldap_uid_field=$c_username))";
core/ldap_api.php:247: $t_search_filter = "(&$t_ldap_organization($t_ldap_uid_field=$t_username)(assignedgroup=$p_group))";
core/ldap_api.php:306: $t_search_filter = "(&$t_ldap_organization($t_ldap_uid_field=$c_username))";
core/database_api.php:438:function db_fetch_array( &$p_result ) {
core/relationship_graph_api.php:308:function relgraph_add_parent( &$p_bug_list, $p_bug_id ) {
core/relationship_graph_api.php:360:function relgraph_add_child( &$p_bug_list, $p_bug_id ) {
core/relationship_graph_api.php:443:function relgraph_add_bug_to_graph( &$p_graph, $p_bug_id, $p_bug, $p_url = null, $p_highlight = false ) {
core/string_api.php:857: return preg_replace( "/&(#[0-9]+|[a-z]+);/i", "&$1;", @htmlspecialchars( $p_string, ENT_COMPAT, 'utf-8' ) );
core/error_api.php:379: return preg_replace( "/&(#[0-9]+|[a-z]+);/i", "&$1;", @htmlspecialchars( $t_string, ENT_COMPAT, 'UTF-8' ) );
core/filter_api.php:882:function filter_get_query_sort_data( &$p_filter, $p_show_sticky, $p_query_clauses ) {
core/filter_api.php:995:function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p_bug_count, $p_custom_filter = null, $p_project_id = null, $p_user_id = null, $p_show_sticky = null ) {
core/relationship_api.php:406: * @param bool &$p_is_different_projects Returned Boolean value indicating if some relationships cross project boundaries
core/relationship_api.php:409:function relationship_get_all( $p_bug_id, &$p_is_different_projects ) {
make_captcha_img.php:255: function makeWebsafeColors(&$image)

Loads of pass-by-reference instances within the library/ directory too.

TagsNo tags attached.

Relationships

related to 0010975 closeddhx eregi_replace() is deprecated in PHP 5.3.0, use preg_replace() with the 'i' modifier instead 
related to 0010974 closedjreese ereg() is deprecated in PHP 5.3.0, use preg_match() instead 
related to 0010973 closeddhx split() is deprecated in PHP 5.3.0, use preg_split() instead 
child of 0016565 closedgrangeway Implement new captcha library 

Activities

joshribakoff

joshribakoff

2009-11-02 05:35

reporter   ~0023537

Gotta love regex.

govind

govind

2013-12-01 22:04

reporter   ~0038684

sdfgdf

govind

govind

2013-12-01 22:05

reporter   ~0038723

xdfjghjgh

Related Changesets

MantisBT: master 8dd28f84

2013-10-15 16:02:42

Paul Richards

Details Diff
New Feature: replace captcha library with open source library. Adds audio support to captcha for accessibility [requires flash on client]

Ported from master-2.x branch

Resolves (Part or all) of bugs:

0010972: openbase_dir breaks captcha generation
0008796: The letters in the catchpa on account creation page are too small
0010976: Remove instances of pass-by-reference (deprecated in PHP 5.3.0)
0010028: Registrations by bots via captcha exploit
0008462: Captcha will benefit supporting other than jpeg format
0008129: Alternative to captchas
mod - core/print_api.php Diff File
mod - library/README.libs Diff File
add - library/securimage/AHGBold.ttf Diff File
add - library/securimage/LICENSE.txt Diff File
add - library/securimage/README.FONT.txt Diff File
add - library/securimage/README.txt Diff File
add - library/securimage/WavFile.php Diff File
add - library/securimage/audio/en/0.wav Diff File
add - library/securimage/audio/en/1.wav Diff File
add - library/securimage/audio/en/10.wav Diff File
add - library/securimage/audio/en/11.wav Diff File
add - library/securimage/audio/en/12.wav Diff File
add - library/securimage/audio/en/13.wav Diff File
add - library/securimage/audio/en/14.wav Diff File
add - library/securimage/audio/en/15.wav Diff File
add - library/securimage/audio/en/16.wav Diff File
add - library/securimage/audio/en/17.wav Diff File
add - library/securimage/audio/en/18.wav Diff File
add - library/securimage/audio/en/19.wav Diff File
add - library/securimage/audio/en/2.wav Diff File
add - library/securimage/audio/en/20.wav Diff File
add - library/securimage/audio/en/3.wav Diff File
add - library/securimage/audio/en/4.wav Diff File
add - library/securimage/audio/en/5.wav Diff File
add - library/securimage/audio/en/6.wav Diff File
add - library/securimage/audio/en/7.wav Diff File
add - library/securimage/audio/en/8.wav Diff File
add - library/securimage/audio/en/9.wav Diff File
add - library/securimage/audio/en/A.wav Diff File
add - library/securimage/audio/en/B.wav Diff File
add - library/securimage/audio/en/C.wav Diff File
add - library/securimage/audio/en/D.wav Diff File
add - library/securimage/audio/en/E.wav Diff File
add - library/securimage/audio/en/F.wav Diff File
add - library/securimage/audio/en/G.wav Diff File
add - library/securimage/audio/en/H.wav Diff File
add - library/securimage/audio/en/I.wav Diff File
add - library/securimage/audio/en/J.wav Diff File
add - library/securimage/audio/en/K.wav Diff File
add - library/securimage/audio/en/L.wav Diff File
add - library/securimage/audio/en/M.wav Diff File
add - library/securimage/audio/en/MINUS.wav Diff File
add - library/securimage/audio/en/N.wav Diff File
add - library/securimage/audio/en/O.wav Diff File
add - library/securimage/audio/en/P.wav Diff File
add - library/securimage/audio/en/PLUS.wav Diff File
add - library/securimage/audio/en/Q.wav Diff File
add - library/securimage/audio/en/R.wav Diff File
add - library/securimage/audio/en/S.wav Diff File
add - library/securimage/audio/en/T.wav Diff File
add - library/securimage/audio/en/TIMES.wav Diff File
add - library/securimage/audio/en/U.wav Diff File
add - library/securimage/audio/en/V.wav Diff File
add - library/securimage/audio/en/W.wav Diff File
add - library/securimage/audio/en/X.wav Diff File
add - library/securimage/audio/en/Y.wav Diff File
add - library/securimage/audio/en/Z.wav Diff File
add - library/securimage/audio/en/error.wav Diff File
add - library/securimage/audio/noise/check-point-1.wav Diff File
add - library/securimage/audio/noise/crowd-talking-1.wav Diff File
add - library/securimage/audio/noise/crowd-talking-6.wav Diff File
add - library/securimage/audio/noise/crowd-talking-7.wav Diff File
add - library/securimage/audio/noise/kids-playing-1.wav Diff File
add - library/securimage/backgrounds/bg3.jpg Diff File
add - library/securimage/backgrounds/bg4.jpg Diff File
add - library/securimage/backgrounds/bg5.jpg Diff File
add - library/securimage/backgrounds/bg6.png Diff File
add - library/securimage/captcha.html Diff File
add - library/securimage/database/.htaccess Diff File
add - library/securimage/database/index.html Diff File
add - library/securimage/database/securimage.sq3 Diff File
add - library/securimage/example_form.ajax.php Diff File
add - library/securimage/example_form.php Diff File
add - library/securimage/images/audio_icon.png Diff File
add - library/securimage/images/refresh.png Diff File
add - library/securimage/securimage.php Diff File
add - library/securimage/securimage_play.php Diff File
add - library/securimage/securimage_play.swf Diff File
add - library/securimage/securimage_show.php Diff File
add - library/securimage/words/words.txt Diff File
rm - make_captcha_img.php Diff File
mod - signup.php Diff File
mod - signup_page.php Diff File

MantisBT: master 513c5e83

2013-10-28 06:01:40

dregad

Details Diff
Remove unnecessary assignment by reference

From dhx's list, most items are in fact not pass-by-references at all.
The list returned by the following command excludes obvious false
positives, and the remaining occurences are not pass-by-references
either.

$ git grep '&\$' |grep -vE "function|Binary|@param"

Fixes 0010976
mod - admin/install.php Diff File

Issue History

Date Modified Username Field Change
2009-09-22 10:46 dhx New Issue
2009-10-06 16:49 jreese Target Version 1.2.0 RC2 => 1.2.2
2009-10-07 04:03 vboctor Status new => acknowledged
2009-10-14 09:23 dhx Relationship added related to 0010975
2009-10-14 09:24 dhx Relationship added related to 0010974
2009-10-14 09:24 dhx Relationship added related to 0010973
2009-11-02 05:35 joshribakoff Note Added: 0023537
2010-01-02 00:53 vboctor Target Version 1.2.2 => 1.3.0-beta.1
2010-01-02 00:53 vboctor Description Updated View Revisions
2013-10-28 06:33 dregad Changeset attached => MantisBT master 513c5e83
2013-10-28 06:33 dregad Assigned To => dregad
2013-10-28 06:33 dregad Status acknowledged => resolved
2013-10-28 06:33 dregad Resolution open => fixed
2013-10-28 06:33 dregad Fixed in Version => 1.3.0-beta.1
2013-11-01 06:44 dregad Relationship added child of 0016565
2013-11-01 06:45 dregad Changeset attached => MantisBT master 8dd28f84
2013-12-01 22:04 govind Note Added: 0038684
2013-12-01 22:05 govind Note Added: 0038723
2014-12-08 00:34 vboctor Status resolved => closed