kummer hat geschrieben:wenn das stimmt, dass der ie die anführungszeichen weglässt, dann wird es in der tat nicht funktionieren. in diesem fall müsste die regex entsprechend angepasst werden.
Hallo Kummer, danke nochmal für das Modul. Es ist eine tolle Leistung!
Ich hoffe meine PM ist bei dir angekommen.
Ich habe anstatt des Popup Fensters die Lightbox-Gallery verwendet.
Aber das hat mit dem Problem nichts zu tun.
Der IE läßt beim speichern (In-Site-Editing) bei allen Attributen wie alt, class height, width die Anführungszeichen weg. Außerdem schreibt er img groß: IMG
Code: Alles auswählen
function atqImageResize($content, $maxWidth, $maxHeight, $mask, & $db) {
//Edit by josh
//IE speichert beim In-Site-Editing height und width ohne Anführungszeichen und schreibt IMG groß
//img
$content=str_replace('IMG', 'img', $content);
//height
if (strpos($content, 'height="') == false ) {
preg_match_all('/height=[0-9]*/', $content, $h);
foreach ($h[0] as $value) {
$ergebnis = 'height="'.str_replace('height=', '', $value).'"';
$content = str_replace($value, $ergebnis, $content);
}
}
//width
if (strpos($content, 'width="') == false ) {
preg_match_all('/width=[0-9]*/', $content, $w);
foreach ($w[0] as $value) {
$ergebnis = 'width="'.str_replace('width=', '', $value).'"';
$content = str_replace($value, $ergebnis, $content);
}
}
//class
if (strpos($content, 'class="') == false ) {
preg_match_all('/class=[a-zA-Z]*/', $content, $c);
foreach ($c[0] as $value) {
$ergebnis = 'class="'.str_replace('class=', '', $value).'"';
$content = str_replace($value, $ergebnis, $content);
}
}
//alt
if (strpos($content, 'alt="') == false ) {
$content = utf8_encode($content);
preg_match_all('/alt=[a-zA-ZäüöÄÜÖß]*/', $content, $a);
foreach ($a[0] as $value) {
$ergebnis = 'alt="'.str_replace('alt=', '', $value).'"';
$content = str_replace($value, $ergebnis, $content);
}
$content = utf8_decode($content);
}
//@Edit
Ich habe da mal was eingebaut, weis aber nicht ob das nicht auch einfacher geht. Beim alt Attribut gab es auf meinem Server ein utf8 Problem.
Bitte schau dir das mal an, ich glaube es ist zumindestens hilfreich für eine Lösung.
Den Code oben habe ich nochmal aktualisiert:
Merkwürdig ist, dass die Anführungszeichen bei alt manchmal da sind.
Deshalb frage ich vorher ab ob die Anführungszeichen gesetzt sind.
Den Code oben direkt unter
function atqImageResize($content, $maxWidth, $maxHeight, $mask, & $db) {
einfügen.
Viele Grüße
josh