Gergő Tisza has uploaded a new change for review.
https://gerrit.wikimedia.org/r/249888
Change subject: Include preg_last_error() in error message when preg_* fails
......................................................................
Include preg_last_error() in error message when preg_* fails
Bug: T115514
Bug: T117066
Change-Id: I1d13f8542a4cf11c8e87cd4f6a983fa852dfdf1e
---
M includes/MagicWord.php
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/88/249888/1
diff --git a/includes/MagicWord.php b/includes/MagicWord.php
index 424735e..17c7cd4 100644
--- a/includes/MagicWord.php
+++ b/includes/MagicWord.php
@@ -954,7 +954,8 @@
$matches = array();
$matched = preg_match_all( $regex, $text, $matches,
PREG_SET_ORDER );
if ( $matched === false ) {
- throw new Exception( __METHOD__ . ':
preg_match_all returned false' );
+ throw new Exception( __METHOD__ . ':
preg_match_all returned false with error code '
+ . preg_last_error() );
}
if ( $matched ) {
foreach ( $matches as $m ) {
@@ -966,7 +967,8 @@
if ( $replaced !== null ) {
$text = $replaced;
} else {
- throw new Exception( __METHOD__ . ':
preg_replace returned null' );
+ throw new Exception( __METHOD__ . ':
preg_replace returned null with error code '
+ . preg_last_error() );
}
}
return $found;
--
To view, visit https://gerrit.wikimedia.org/r/249888
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d13f8542a4cf11c8e87cd4f6a983fa852dfdf1e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.4
Gerrit-Owner: Gergő Tisza <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits