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.
Comments
Comment #1
claudiu.cristeaPatch.
Comment #2
claudiu.cristeaBetter
Comment #3
yesct CreditAttribution: yesct commentedComment #4
cshikai CreditAttribution: cshikai commentedHi, 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?
Comment #5
claudiu.cristeaProbably you need:
> patch -p1 < 2303381-2.patch
Comment #6
cshikai CreditAttribution: cshikai commentedThanks 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 :)
Comment #7
claudiu.cristeaThis is wrong. -p1 instead of -1
You need to:
Comment #8
gauravkhambhala CreditAttribution: gauravkhambhala at KNOWARTH commentedI 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