mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-05 16:08:12 +01:00
Validation tweaks. fixes #2097
git-svn-id: http://svn.automattic.com/wordpress/trunk@3329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dbbd5efeb2
commit
4f3bef3ac1
@ -93,7 +93,7 @@ function fix_attachment_links($post_ID) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$search = "# id=(\"|)(\d+)\\1#i";
|
$search = "# id=(\"|')p(\d+)\\1#i";
|
||||||
foreach ( $anchor_matches[0] as $anchor ) {
|
foreach ( $anchor_matches[0] as $anchor ) {
|
||||||
if ( 0 == preg_match($search, $anchor, $id_matches) )
|
if ( 0 == preg_match($search, $anchor, $id_matches) )
|
||||||
continue;
|
continue;
|
||||||
|
@ -232,7 +232,7 @@ srcb[{$ID}] = '{$image['guid']}';
|
|||||||
$xpadding = (128 - $image['uwidth']) / 2;
|
$xpadding = (128 - $image['uwidth']) / 2;
|
||||||
$ypadding = (96 - $image['uheight']) / 2;
|
$ypadding = (96 - $image['uheight']) / 2;
|
||||||
$style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n";
|
$style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n";
|
||||||
$script .= "aa[{$ID}] = '<a id=\"{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
|
$script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
|
||||||
ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
|
ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$image['post_title']}\">';
|
||||||
imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$image['post_title']}\" $height_width />';
|
imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$image['post_title']}\" $height_width />';
|
||||||
imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$image['post_title']}\" $height_width />';
|
imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$image['post_title']}\" $height_width />';
|
||||||
@ -255,15 +255,15 @@ imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$image['po
|
|||||||
$filename = basename($attachment['guid']);
|
$filename = basename($attachment['guid']);
|
||||||
$icon = get_attachment_icon($ID);
|
$icon = get_attachment_icon($ID);
|
||||||
$toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>";
|
$toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>";
|
||||||
$script .= "aa[{$ID}] = '<a id=\"{$ID}\" rel=\"attachment\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>';
|
$script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>';
|
||||||
ab[{$ID}] = '<a id=\"{$ID}\" href=\"{$filename}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>';
|
ab[{$ID}] = '<a id=\"p{$ID}\" href=\"{$filename}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>';
|
||||||
title[{$ID}] = '{$attachment['post_title']}';
|
title[{$ID}] = '{$attachment['post_title']}';
|
||||||
filename[{$ID}] = '{$filename}';
|
filename[{$ID}] = '{$filename}';
|
||||||
icon[{$ID}] = '{$icon}';
|
icon[{$ID}] = '{$icon}';
|
||||||
";
|
";
|
||||||
$html .= "<div id='target{$ID}' class='attwrap left'>
|
$html .= "<div id='target{$ID}' class='attwrap left'>
|
||||||
<div id='div{$ID}' class='otherwrap usingtext' onmousedown=\"selectLink({$ID})\" onclick=\"doPopup({$ID});return false;\">
|
<div id='div{$ID}' class='otherwrap usingtext' onmousedown=\"selectLink({$ID})\" onclick=\"doPopup({$ID});return false;\">
|
||||||
<a id=\"{$ID}\" href=\"{$attachment['guid']}\" onmousedown=\"selectLink({$ID});\" onclick=\"return false;\">{$attachment['post_title']}</a>
|
<a id=\"p{$ID}\" href=\"{$attachment['guid']}\" onmousedown=\"selectLink({$ID});\" onclick=\"return false;\">{$attachment['post_title']}</a>
|
||||||
</div>
|
</div>
|
||||||
{$noscript}
|
{$noscript}
|
||||||
</div>
|
</div>
|
||||||
@ -346,7 +346,7 @@ function toggleLink(n) {
|
|||||||
function toggleOtherLink(n) {
|
function toggleOtherLink(n) {
|
||||||
od=document.getElementById('div'+n);
|
od=document.getElementById('div'+n);
|
||||||
ol=document.getElementById('L'+n);
|
ol=document.getElementById('L'+n);
|
||||||
oi=document.getElementById(n);
|
oi=document.getElementById('p'+n);
|
||||||
ih=oi.innerHTML;
|
ih=oi.innerHTML;
|
||||||
if ( ol.innerHTML == linkedtofile ) {
|
if ( ol.innerHTML == linkedtofile ) {
|
||||||
od.innerHTML = aa[n];
|
od.innerHTML = aa[n];
|
||||||
@ -355,7 +355,7 @@ function toggleOtherLink(n) {
|
|||||||
od.innerHTML = ab[n];
|
od.innerHTML = ab[n];
|
||||||
ol.innerHTML = linkedtofile;
|
ol.innerHTML = linkedtofile;
|
||||||
}
|
}
|
||||||
oi=document.getElementById(n);
|
oi=document.getElementById('p'+n);
|
||||||
oi.innerHTML = ih;
|
oi.innerHTML = ih;
|
||||||
}
|
}
|
||||||
function toggleImage(n) {
|
function toggleImage(n) {
|
||||||
@ -371,7 +371,7 @@ function toggleImage(n) {
|
|||||||
}
|
}
|
||||||
function toggleOtherIcon(n) {
|
function toggleOtherIcon(n) {
|
||||||
od = document.getElementById('div'+n);
|
od = document.getElementById('div'+n);
|
||||||
o = document.getElementById(n);
|
o = document.getElementById('p'+n);
|
||||||
oi = document.getElementById('I'+n);
|
oi = document.getElementById('I'+n);
|
||||||
if ( oi.innerHTML == usingtitle ) {
|
if ( oi.innerHTML == usingtitle ) {
|
||||||
o.innerHTML = filename[n];
|
o.innerHTML = filename[n];
|
||||||
|
@ -534,7 +534,7 @@ function get_attachment_icon($id = 0, $fullsize = false, $max_dims = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$icon = "<img src=\"{$src}\" title=\"{$post->post_title}\" {$constraint}/>";
|
$icon = "<img src=\"{$src}\" title=\"{$post->post_title}\" alt=\"{$post->post_title}\" {$constraint}/>";
|
||||||
|
|
||||||
return apply_filters('attachment_icon', $icon, $post->ID);
|
return apply_filters('attachment_icon', $icon, $post->ID);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user