mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX HTMLEditorField->saveInto() can now find images with urlencoded information for resample (e.g. spaces in filenames)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100985 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3f3c2b2fe9
commit
fcfd1f7d5b
@ -104,8 +104,7 @@ class HtmlEditorField extends TextareaField {
|
|||||||
if($images = $htmlValue->getElementsByTagName('img')) foreach($images as $img) {
|
if($images = $htmlValue->getElementsByTagName('img')) foreach($images as $img) {
|
||||||
// strip any ?r=n data from the src attribute
|
// strip any ?r=n data from the src attribute
|
||||||
$img->setAttribute('src', preg_replace('/([^\?]*)\?r=[0-9]+$/i', '$1', $img->getAttribute('src')));
|
$img->setAttribute('src', preg_replace('/([^\?]*)\?r=[0-9]+$/i', '$1', $img->getAttribute('src')));
|
||||||
|
if(!$image = File::find($path = urldecode(Director::makeRelative($img->getAttribute('src'))))) {
|
||||||
if(!$image = File::find($path = Director::makeRelative($img->getAttribute('src')))) {
|
|
||||||
if(substr($path, 0, strlen(ASSETS_DIR) + 1) == ASSETS_DIR . '/') {
|
if(substr($path, 0, strlen(ASSETS_DIR) + 1) == ASSETS_DIR . '/') {
|
||||||
$record->HasBrokenFile = true;
|
$record->HasBrokenFile = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user