https://bugzilla.wikimedia.org/show_bug.cgi?id=27265

           Summary: Usage of deprecated PHP functions
           Product: MediaWiki
           Version: 1.16.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: General/Unknown
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: wikime...@monosock.org


Deprecated PHP functions are used in the PHP code.

-------------------------------------------------------------------------------
#!/bin/bash
#
# PHP 5.3 Deprecated function checker
#
# Author: Michiel Roos <mich...@donationbasedhosting.org>
# 
# http://www.php.net/manual/en/migration53.deprecated.php
# 
# Please note that there will be some false positives. Some PHP code is mixed
# with JS code. In JS 'split' is still a valid function.
#

deprecatedFunctions=(
        call_user_method
        call_user_method_array
        define_syslog_variables
        dl
        ereg
        ereg_replace
        eregi
        eregi_replace
        set_magic_quotes_runtime
        session_register
        session_unregister
        session_is_registered
        set_socket_blocking
        split
        spliti
        sql_regcase
        mysql_db_query
        mysql_escape_string
)
len=${#deprecatedFunctions[*]}
i=0

while [ $i -lt $len ]; do
        echo "  // checking for '${deprecatedFunctions[$i]}()'"
        grep -rn --color --include=*.php
"[^a-zA-Z_]${deprecatedFunctions[$i]}(" *;
        echo ""
        let i++
done
-------------------------------------------------------------------------------

        // checking for 'dl()'
config/Installer.php:348:       if( extension_loaded( $compname ) || (
mw_have_dl() && dl( "{$compname}." . PHP_SHLIB_SUFFIX ) ) ) {
HISTORY:2595:* (bug 11013) Make sure dl() is available before attempting to use
it to check
includes/DifferenceEngine.php:438:                             
dl('php_wikidiff.so');
includes/DifferenceEngine.php:448:                             
@dl('php_wikidiff2.so');
includes/MimeMagic.php:105:     if(!extension_loaded('fileinfo'))
dl('fileinfo.' . PHP_SHLIB_SUFFIX);
includes/db/DatabaseMssql.php:71:                       @dl('mssql.so');
includes/db/DatabaseMysql.php:30:                       @dl('mysql.so');
includes/db/DatabaseIbm_db2.php:488:                    @dl('ibm_db2.so');
includes/diff/DifferenceInterface.php:656:                      dl(
'php_wikidiff.so' );
includes/diff/DifferenceInterface.php:663:                      dl(
'php_wikidiff2.so' );
includes/Database.php:567:                      @dl('mysql.so');
includes/normal/UtfNormalTest.php:48:   dl( 'php_utfnormal.so' );
includes/normal/UtfNormalBench.php:29:  dl( 'php_utfnormal.so' );
includes/normal/CleanUpTest.php:27:     dl( 'php_utfnormal.so' );
install-utils.inc:128: * Is dl() available to us?
install-utils.inc:130: * According to
http://uk.php.net/manual/en/function.dl.php, dl()

        // checking for 'ereg()'
includes/db/DatabaseMssql.php:568:#                     if
(ereg('_id$',$keys[0])) {
includes/db/DatabaseMssql.php:577:#                     if
(ereg('_id$',$keys[0]) && empty($a[$keys[0]])) unset($a[$keys[0]]); # remove
primary-key column from insert list if empty value
includes/db/DatabaseMssql.php:879:              return
ereg("^(.+[0-9]+\\.[0-9]+\\.[0-9]+) ",$row[0],$m) ? $m[1] : $row[0];
includes/SpecialUpload.php:516:                 && ereg( "[0-9]{2}" , substr(
$partname , 0, 2) ) )
maintenance/fuzz-tester.php:2623:        if (!ereg("(.*)" . str_replace(".",
"\.", DATA_FILE) . "$", $file, $matches)) continue;

        // checking for 'ereg_replace()'
includes/db/DatabaseMssql.php:836:                      $sql =
ereg_replace("^SELECT", "SELECT TOP $limit", $sql);

        // checking for 'eregi()'
includes/SpecialUpload.php:1133:                if (eregi("<!DOCTYPE
*X?HTML",$chunk)) return true;

        // checking for 'split()'
includes/filerepo/ICRepo.php:179:                       list($key,$value) =
split("=",$match);

        // checking for 'mysql_escape_string()'
maintenance/namespace2sql.php:9:        $nsname = mysql_escape_string(
$wgLang->getNsText( $i ) );
maintenance/namespace2sql.php:10:       $dbname = mysql_escape_string(
$wgDBname );

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to