Problem/Motivation

In PHP 5.5 the PCRE /e modifier is deprecated, causing the interpreter to popup a notice:

Deprecated function: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in DatabaseConnection_oracle->escapeAnsi() (line 484 of includes/database/oracle/database.inc).

and

Deprecated function: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in DatabaseConnection_oracle->escapeReserved() (line 523 of includes/database/oracle/database.inc).

Proposed resolution

Replace preg_replace() with preg_replace_callback() where the /e modifier is used.

Greping in the code, it gives...

$ grep -nr "/e" includes/database/oracle
includes/database/oracle/database.inc:474:     $search = array ('/("\w+?")/e',
includes/database/oracle/database.inc:509:        $search = array ("/({)(\w+)(})/e", // escapes all table names
includes/database/oracle/database.inc:510:                         "/({L#)([0-9]+)(})/e", // escapes long id
includes/database/oracle/database.inc:511:		                 "/(\:)(uid|level|session|file|access|mode|comment|desc|size|start|end)/e",
includes/database/oracle/database.inc:512:			   	         "/(<uid>|<level>|<session>|<file>|<access>|<mode>|<comment>|<desc>|<size>".($ddl?'':'|<date>').")/e",
includes/database/oracle/database.inc:513:			   	         '/([\(\.\s,\=])(uid|level|session|file|access|mode|comment|desc|size'.($ddl?'':'|date').')([,\s\=)])/e',
includes/database/oracle/database.inc:514:                         '/([\(\.\s,])(uid|level|session|file|access|mode|comment|desc|size'.($ddl?'':'|date').')$/e');
includes/database/oracle/module/oracle/oracle.module:63:  $items['admin/config/development/oracle/edit/translation'] = array(

Remaining tasks

Fix. Patch. RTBC. Commit.

User interface changes

None.

API changes

None.

Tag1 Consulting supports Drupal.Tag1 logo

Comments

claudiu.cristea’s picture

Status: Active » Needs review
FileSize
3.99 KB

Patch.

claudiu.cristea’s picture

FileSize
4.03 KB

Better

yesct’s picture

Issue tags: -php-5.5 +PHP 5.5
cshikai’s picture

Hi, i am having issues patching the file at includes/database/oracle/database.inc. The HUNKS fails when i execute the command

patch --binary < 2303381-2.patch

in GnuWin32. Is there something i am missing out?

claudiu.cristea’s picture

Probably you need:

> patch -p1 < 2303381-2.patch

cshikai’s picture

Thanks for your help! But the problem still persist

$patch -1 <2393382-3.patch
patching file database.inc
Hunk #1 FAILED at 465.
Hunk #2 FAILED at 503.
2 out of 2 hunks FAILED -- saving rejects to file database.inc.rej

Is it because maybe the version of the database.inc is different?

EDIT: If it helps, i am running windows 8.1 and not linux :)

claudiu.cristea’s picture

$patch -1 <2393382-3.patch

This is wrong. -p1 instead of -1

You need to:

  1. Use the latest from dev (https://www.drupal.org/node/462038)
  2. Go into (cd) module/driver directory
  3. Apply the patch.
gauravkhambhala’s picture

I manually tried applying this patch in newer version.

Resulted in following error:

PHP Fatal error: Call to undefined function drupal_strtoupper() in /var/www/html/drupal/includes/database/oracle/database.inc