浏览代码

Add support for PREG_JIT_STACKLIMIT_ERROR, refs #5104

Jordi Boggiano 9 年之前
父节点
当前提交
2217f4e09e
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/Composer/Json/JsonManipulator.php

+ 6 - 0
src/Composer/Json/JsonManipulator.php

@@ -422,6 +422,12 @@ class JsonManipulator
                     throw new \RuntimeException('Failed to execute regex: PREG_BAD_UTF8_ERROR', PREG_BAD_UTF8_ERROR);
                     throw new \RuntimeException('Failed to execute regex: PREG_BAD_UTF8_ERROR', PREG_BAD_UTF8_ERROR);
                 case PREG_BAD_UTF8_OFFSET_ERROR:
                 case PREG_BAD_UTF8_OFFSET_ERROR:
                     throw new \RuntimeException('Failed to execute regex: PREG_BAD_UTF8_OFFSET_ERROR', PREG_BAD_UTF8_OFFSET_ERROR);
                     throw new \RuntimeException('Failed to execute regex: PREG_BAD_UTF8_OFFSET_ERROR', PREG_BAD_UTF8_OFFSET_ERROR);
+                case 6: // PREG_JIT_STACKLIMIT_ERROR
+                    if (PHP_VERSION_ID > 70000) {
+                        throw new \RuntimeException('Failed to execute regex: PREG_JIT_STACKLIMIT_ERROR', 6);
+                    }
+                    // fallthrough
+
                 default:
                 default:
                     throw new \RuntimeException('Failed to execute regex: Unknown error');
                     throw new \RuntimeException('Failed to execute regex: Unknown error');
             }
             }