Updating dbkiss.php for deprecated preg_replace() function and PHP7/Postgres compatibility












0















I use the dbkiss database frontend application (see code: github/dbkiss.php) which now appears to be unsupported. It works with PHP5 but now breaks with PHP7 with the following error:



preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
In dbkiss.php on line 308.
Backtrace#1 preg_replace(#([a-z]+://[a-zA-Z0-9.,;:[]{}-_+=!@#%&()/?`~]+)#e, create_links_eval("1"), GG3) called at [/var/www/html/r4stdb/dbkiss.php:308]
#2 create_links(GG3) called at [/var/www/html/r4stdb/dbkiss.php:4732]


I found 26 lines that use the deprecated preg_replace() function. Below is a sample of the affected lines:



$trace = preg_replace("/^#0[sS]+?n#1/", "#1", $trace); // Remove call to errorHandler() from trace.
$text = preg_replace('#([a-z]+://[a-zA-Z0-9.,;:[]{}-_+=!@#%&()/?`~]+)#e', 'create_links_eval("\1")', $text);
$query = preg_replace('#^([sS]+)LIMITs+d+s+OFFSETs+d+s*$#i', '$1', $query);
$query = preg_replace('#^([sS]+)LIMITs+d+s*,s*d+s*$#i', '$1', $query);
$query = preg_replace("#^({$words})(s)#i", '<font color="'.$color.'">$1</font>$2', $query);
$query = preg_replace("#(s)({$words})$#i", '$1<font color="'.$color.'">$2</font>', $query);
$query = preg_replace("#([s(),])({$words})([s(),])#i", '$1<font color="'.$color.'">$2</font>$3', $query);
$query = preg_replace("#([s(),])({$words})([s(),])#i", '$1<font color="'.$color.'">$2</font>$3', $query);
...


This is a very handy open source tool that should stay current! I would be grateful if someone could fork this code on github and update it to work with PHP7 and a Postgres (v10.6) database having tables and views.










share|improve this question























  • It's a well known question, have a look at stackoverflow.com/q/15454220/372239

    – Toto
    Jan 7 at 11:30











  • preg_replace is not deprecated, it's the use of "e" modifier in the regexp that is, in your code it only affect the second regexp. That beeing said it really doesn't look like particularly great php code ...

    – silmaril
    Jan 7 at 11:35
















0















I use the dbkiss database frontend application (see code: github/dbkiss.php) which now appears to be unsupported. It works with PHP5 but now breaks with PHP7 with the following error:



preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
In dbkiss.php on line 308.
Backtrace#1 preg_replace(#([a-z]+://[a-zA-Z0-9.,;:[]{}-_+=!@#%&()/?`~]+)#e, create_links_eval("1"), GG3) called at [/var/www/html/r4stdb/dbkiss.php:308]
#2 create_links(GG3) called at [/var/www/html/r4stdb/dbkiss.php:4732]


I found 26 lines that use the deprecated preg_replace() function. Below is a sample of the affected lines:



$trace = preg_replace("/^#0[sS]+?n#1/", "#1", $trace); // Remove call to errorHandler() from trace.
$text = preg_replace('#([a-z]+://[a-zA-Z0-9.,;:[]{}-_+=!@#%&()/?`~]+)#e', 'create_links_eval("\1")', $text);
$query = preg_replace('#^([sS]+)LIMITs+d+s+OFFSETs+d+s*$#i', '$1', $query);
$query = preg_replace('#^([sS]+)LIMITs+d+s*,s*d+s*$#i', '$1', $query);
$query = preg_replace("#^({$words})(s)#i", '<font color="'.$color.'">$1</font>$2', $query);
$query = preg_replace("#(s)({$words})$#i", '$1<font color="'.$color.'">$2</font>', $query);
$query = preg_replace("#([s(),])({$words})([s(),])#i", '$1<font color="'.$color.'">$2</font>$3', $query);
$query = preg_replace("#([s(),])({$words})([s(),])#i", '$1<font color="'.$color.'">$2</font>$3', $query);
...


This is a very handy open source tool that should stay current! I would be grateful if someone could fork this code on github and update it to work with PHP7 and a Postgres (v10.6) database having tables and views.










share|improve this question























  • It's a well known question, have a look at stackoverflow.com/q/15454220/372239

    – Toto
    Jan 7 at 11:30











  • preg_replace is not deprecated, it's the use of "e" modifier in the regexp that is, in your code it only affect the second regexp. That beeing said it really doesn't look like particularly great php code ...

    – silmaril
    Jan 7 at 11:35














0












0








0








I use the dbkiss database frontend application (see code: github/dbkiss.php) which now appears to be unsupported. It works with PHP5 but now breaks with PHP7 with the following error:



preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
In dbkiss.php on line 308.
Backtrace#1 preg_replace(#([a-z]+://[a-zA-Z0-9.,;:[]{}-_+=!@#%&()/?`~]+)#e, create_links_eval("1"), GG3) called at [/var/www/html/r4stdb/dbkiss.php:308]
#2 create_links(GG3) called at [/var/www/html/r4stdb/dbkiss.php:4732]


I found 26 lines that use the deprecated preg_replace() function. Below is a sample of the affected lines:



$trace = preg_replace("/^#0[sS]+?n#1/", "#1", $trace); // Remove call to errorHandler() from trace.
$text = preg_replace('#([a-z]+://[a-zA-Z0-9.,;:[]{}-_+=!@#%&()/?`~]+)#e', 'create_links_eval("\1")', $text);
$query = preg_replace('#^([sS]+)LIMITs+d+s+OFFSETs+d+s*$#i', '$1', $query);
$query = preg_replace('#^([sS]+)LIMITs+d+s*,s*d+s*$#i', '$1', $query);
$query = preg_replace("#^({$words})(s)#i", '<font color="'.$color.'">$1</font>$2', $query);
$query = preg_replace("#(s)({$words})$#i", '$1<font color="'.$color.'">$2</font>', $query);
$query = preg_replace("#([s(),])({$words})([s(),])#i", '$1<font color="'.$color.'">$2</font>$3', $query);
$query = preg_replace("#([s(),])({$words})([s(),])#i", '$1<font color="'.$color.'">$2</font>$3', $query);
...


This is a very handy open source tool that should stay current! I would be grateful if someone could fork this code on github and update it to work with PHP7 and a Postgres (v10.6) database having tables and views.










share|improve this question














I use the dbkiss database frontend application (see code: github/dbkiss.php) which now appears to be unsupported. It works with PHP5 but now breaks with PHP7 with the following error:



preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
In dbkiss.php on line 308.
Backtrace#1 preg_replace(#([a-z]+://[a-zA-Z0-9.,;:[]{}-_+=!@#%&()/?`~]+)#e, create_links_eval("1"), GG3) called at [/var/www/html/r4stdb/dbkiss.php:308]
#2 create_links(GG3) called at [/var/www/html/r4stdb/dbkiss.php:4732]


I found 26 lines that use the deprecated preg_replace() function. Below is a sample of the affected lines:



$trace = preg_replace("/^#0[sS]+?n#1/", "#1", $trace); // Remove call to errorHandler() from trace.
$text = preg_replace('#([a-z]+://[a-zA-Z0-9.,;:[]{}-_+=!@#%&()/?`~]+)#e', 'create_links_eval("\1")', $text);
$query = preg_replace('#^([sS]+)LIMITs+d+s+OFFSETs+d+s*$#i', '$1', $query);
$query = preg_replace('#^([sS]+)LIMITs+d+s*,s*d+s*$#i', '$1', $query);
$query = preg_replace("#^({$words})(s)#i", '<font color="'.$color.'">$1</font>$2', $query);
$query = preg_replace("#(s)({$words})$#i", '$1<font color="'.$color.'">$2</font>', $query);
$query = preg_replace("#([s(),])({$words})([s(),])#i", '$1<font color="'.$color.'">$2</font>$3', $query);
$query = preg_replace("#([s(),])({$words})([s(),])#i", '$1<font color="'.$color.'">$2</font>$3', $query);
...


This is a very handy open source tool that should stay current! I would be grateful if someone could fork this code on github and update it to work with PHP7 and a Postgres (v10.6) database having tables and views.







php






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 6 at 17:45









user981657user981657

1




1













  • It's a well known question, have a look at stackoverflow.com/q/15454220/372239

    – Toto
    Jan 7 at 11:30











  • preg_replace is not deprecated, it's the use of "e" modifier in the regexp that is, in your code it only affect the second regexp. That beeing said it really doesn't look like particularly great php code ...

    – silmaril
    Jan 7 at 11:35



















  • It's a well known question, have a look at stackoverflow.com/q/15454220/372239

    – Toto
    Jan 7 at 11:30











  • preg_replace is not deprecated, it's the use of "e" modifier in the regexp that is, in your code it only affect the second regexp. That beeing said it really doesn't look like particularly great php code ...

    – silmaril
    Jan 7 at 11:35

















It's a well known question, have a look at stackoverflow.com/q/15454220/372239

– Toto
Jan 7 at 11:30





It's a well known question, have a look at stackoverflow.com/q/15454220/372239

– Toto
Jan 7 at 11:30













preg_replace is not deprecated, it's the use of "e" modifier in the regexp that is, in your code it only affect the second regexp. That beeing said it really doesn't look like particularly great php code ...

– silmaril
Jan 7 at 11:35





preg_replace is not deprecated, it's the use of "e" modifier in the regexp that is, in your code it only affect the second regexp. That beeing said it really doesn't look like particularly great php code ...

– silmaril
Jan 7 at 11:35










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1391216%2fupdating-dbkiss-php-for-deprecated-preg-replace-function-and-php7-postgres-com%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1391216%2fupdating-dbkiss-php-for-deprecated-preg-replace-function-and-php7-postgres-com%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

RAC Tourist Trophy