Changeset 1727
- Timestamp:
- 10/02/2004 12:46:30 AM (21 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload.php
r1576 r1727 81 81 <?php //Makes sure they choose a file 82 82 83 //print_r($ HTTP_POST_FILES);83 //print_r($_FILES); 84 84 //die(); 85 85 86 86 87 $imgalt = (isset($_POST['imgalt'])) ? $_POST['imgalt'] : $imgalt;88 89 $img1_name = (strlen($imgalt)) ? $ _POST['imgalt'] : $HTTP_POST_FILES['img1']['name'];90 $img1_type = (strlen($imgalt)) ? $_POST['img1_type'] : $ HTTP_POST_FILES['img1']['type'];91 $imgdesc = str_replace('"', '&quot;', $_POST['imgdesc']);87 $imgalt = basename( (isset($_POST['imgalt'])) ? $_POST['imgalt'] : '' ); 88 89 $img1_name = (strlen($imgalt)) ? $imgalt : basename( $_FILES['img1']['name'] ); 90 $img1_type = (strlen($imgalt)) ? $_POST['img1_type'] : $_FILES['img1']['type']; 91 $imgdesc = htmlentities2($imgdesc); 92 92 93 93 $imgtype = explode(".",$img1_name); … … 100 100 if (strlen($imgalt)) { 101 101 $pathtofile = get_settings('fileupload_realpath')."/".$imgalt; 102 $img1 = $_POST['img1'] ;102 $img1 = $_POST['img1']['tmp_name']; 103 103 } else { 104 104 $pathtofile = get_settings('fileupload_realpath')."/".$img1_name; 105 $img1 = $ HTTP_POST_FILES['img1']['tmp_name'];105 $img1 = $_FILES['img1']['tmp_name']; 106 106 } 107 107 … … 192 192 } 193 193 elseif($_POST['thumbsize'] == 'custom') { 194 $max_side = $_POST['imgthumbsizecustom'];194 $max_side = intval($_POST['imgthumbsizecustom']); 195 195 } 196 196 -
trunk/wp-includes/functions.php
r1726 r1727 1717 1717 } 1718 1718 1719 // Borrowed from the PHP Manual user notes. Convert entities, while 1720 // preserving already-encoded entities: 1721 function htmlentities2($myHTML) { 1722 $translation_table=get_html_translation_table (HTML_ENTITIES,ENT_QUOTES); 1723 $translation_table[chr(38)] = '&'; 1724 return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($myHTML, $translation_table)); 1725 } 1726 1719 1727 ?>
Note: See TracChangeset
for help on using the changeset viewer.