mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 14:46:19 +08:00 
			
		
		
		
	Fixes #16974: Regular Expression Validator to include support for 'u' (UTF-8) modifier
This commit is contained in:
		
				
					committed by
					
						
						Alexander Makarov
					
				
			
			
				
	
			
			
			
						parent
						
							e0e73cf5b5
						
					
				
				
					commit
					a790685e66
				
			@ -4,6 +4,7 @@ Yii Framework 2 Change Log
 | 
				
			|||||||
2.0.16 under development
 | 
					2.0.16 under development
 | 
				
			||||||
------------------------
 | 
					------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Bug #16974: Regular Expression Validator to include support for 'u' (UTF-8) modifier (Dzhuneyt)
 | 
				
			||||||
- Chg #16941: Set `yii\console\controllers\MigrateController::useTablePrefix` to true as default value (GHopperMSK)
 | 
					- Chg #16941: Set `yii\console\controllers\MigrateController::useTablePrefix` to true as default value (GHopperMSK)
 | 
				
			||||||
- Bug #16966: Fix ArrayExpression support in related tables (GHopperMSK)
 | 
					- Bug #16966: Fix ArrayExpression support in related tables (GHopperMSK)
 | 
				
			||||||
- Bug #16891: Fixed Pagination::totalCount initialized incorrectly (taobig)
 | 
					- Bug #16891: Fixed Pagination::totalCount initialized incorrectly (taobig)
 | 
				
			||||||
 | 
				
			|||||||
@ -2318,7 +2318,7 @@ class BaseHtml
 | 
				
			|||||||
            $pattern = substr($pattern, 0, $pos + 1);
 | 
					            $pattern = substr($pattern, 0, $pos + 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (!empty($flag)) {
 | 
					        if (!empty($flag)) {
 | 
				
			||||||
            $pattern .= preg_replace('/[^igm]/', '', $flag);
 | 
					            $pattern .= preg_replace('/[^igmu]/', '', $flag);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $pattern;
 | 
					        return $pattern;
 | 
				
			||||||
 | 
				
			|||||||
@ -1800,6 +1800,11 @@ EOD;
 | 
				
			|||||||
        $expected = '/([a-z0-9-]+)/gim';
 | 
					        $expected = '/([a-z0-9-]+)/gim';
 | 
				
			||||||
        $actual = Html::escapeJsRegularExpression('/([a-z0-9-]+)/Ugimex');
 | 
					        $actual = Html::escapeJsRegularExpression('/([a-z0-9-]+)/Ugimex');
 | 
				
			||||||
        $this->assertSame($expected, $actual);
 | 
					        $this->assertSame($expected, $actual);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // Make sure that just allowed REGEX modifiers remain after the escaping
 | 
				
			||||||
 | 
					        $expected = '/([a-z0-9-]+)/ugim';
 | 
				
			||||||
 | 
					        $actual = Html::escapeJsRegularExpression('/([a-z0-9-]+)/dugimex');
 | 
				
			||||||
 | 
					        $this->assertSame($expected, $actual);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function testActiveDropDownList()
 | 
					    public function testActiveDropDownList()
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user