aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_bbcodes.php
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-06-24 16:36:15 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-06-24 16:36:15 +0200
commit6bcf12a558bed49267aba12b6ef000c52e8632e2 (patch)
tree98a791e859b40d3ede55e335a1da68417fe7cbfc /phpBB/includes/acp/acp_bbcodes.php
parentd430acb5680ddfd249daf1bd41a268ed47a6823e (diff)
parentc30e0610e938b40a8c04463d2b8de5a64ee59210 (diff)
downloadforums-6bcf12a558bed49267aba12b6ef000c52e8632e2.tar
forums-6bcf12a558bed49267aba12b6ef000c52e8632e2.tar.gz
forums-6bcf12a558bed49267aba12b6ef000c52e8632e2.tar.bz2
forums-6bcf12a558bed49267aba12b6ef000c52e8632e2.tar.xz
forums-6bcf12a558bed49267aba12b6ef000c52e8632e2.zip
Merge pull request #3618 from marc1706/ticket/13832
[ticket/13832] Use preg_replace_callback instead of /e modifier
Diffstat (limited to 'phpBB/includes/acp/acp_bbcodes.php')
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 2b438e5670..c9225a7eae 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -489,7 +489,9 @@ class acp_bbcodes
if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad))
{
$repad = $pad + sizeof(array_unique($repad[0]));
- $replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\${' . (\$1 + \$pad) . '}'", $replace);
+ $replace = preg_replace_callback('/(?<!\\\\)\$([0-9]+)/', function ($match) use ($pad) {
+ return '${' . ($match[1] + $pad) . '}';
+ }, $replace);
$pad = $repad;
}
@@ -554,10 +556,18 @@ class acp_bbcodes
trigger_error($user->lang['BBCODE_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $fp_match = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $fp_match);
- $fp_replace = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $fp_replace);
- $sp_match = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $sp_match);
- $sp_replace = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $sp_replace);
+ $fp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
+ return strtolower($match[0]);
+ }, $fp_match);
+ $fp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
+ return strtolower($match[0]);
+ }, $fp_replace);
+ $sp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
+ return strtolower($match[0]);
+ }, $sp_match);
+ $sp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
+ return strtolower($match[0]);
+ }, $sp_replace);
return array(
'bbcode_tag' => $bbcode_tag,
"hl kwa"></a> <a href="author.html#3183">[ author ]</a> </LI> </UL> <HR> <!--beginarticle--> <PRE>Le mercredi 23 mars 2011 &#224; 17:07 +0100, Romain d'Alverny a &#233;crit : &gt;<i> On Wed, Mar 23, 2011 at 17:00, Michael Scherer &lt;<A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">misc at zarb.org</A>&gt; wrote: </I>&gt;<i> &gt; What about if people do not want to be co-maintainer when they do a </I>&gt;<i> &gt; massive rebuild ( like for example, when a new version of python is </I>&gt;<i> &gt; upgraded, I often rebuild everything or push simple rebuild ) ? </I>&gt;<i> </I>&gt;<i> Is there a specific flag set when doing this? or can the buildsystem </I>&gt;<i> detect that the upload is more about just rebuilding than pushing a </I>&gt;<i> change? </I> Nope, that's the problem :/ &gt;<i> Nonetheless, we can consider that co-maintainers would be those whose </I>&gt;<i> activity is significant on a given package - unless massive rebuilds </I>&gt;<i> occurs at about the same (or a higher) frequency as regular </I>&gt;<i> maintainance uploads. </I> The way we did before was &quot;3 uploads in a row and you become maintainer&quot;. But thing start to become complex on the server side, as you may have to parse changelog, stuff like that. This and we didn't rely much on being maintainer so it was not critical to have the information right :) -- Michael Scherer </PRE> <!--endarticle--> <HR> <P><UL> <!--threads--> <LI>Previous message: <A HREF="003182.html">[Mageia-sysadm] buildsystem =&gt; maintdb link test </A></li> <LI>Next message: <A HREF="003189.html">[Mageia-sysadm] buildsystem =&gt; maintdb link test </A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#3183">[ date ]</a> <a href="thread.html#3183">[ thread ]</a> <a href="subject.html#3183">[ subject ]</a> <a href="author.html#3183">[ author ]</a> </LI> </UL> <hr> <a href="https://www.mageia.org/mailman/listinfo/mageia-sysadm">More information about the Mageia-sysadm mailing list</a><br> </body></html>