function mb_convert_encoding($string = '', $out_charset = 'utf-8', $in_charset = 'utf-8') { if (strtolower($in_charset) == 'utf-16be') { $in_charset = 'utf-8'; } if (strtolower($out_charset) == 'utf-16be') { $out_charset = 'utf-8'; } return makeCharsetConversion($string, $in_charset, $out_charset); }
$article_thumbnail = str_replace($feedimport_result['cnt_object']['image_url_replace'][0], $feedimport_result['cnt_object']['image_url_replace'][1], $article_thumbnail); } $article_thumbnail_name = basename($article_thumbnail); $article_thumbnail_hash = md5($article_thumbnail_name . microtime()); $article_thumbnail_store = PHPWCMS_STORAGE . $article_thumbnail_hash . '.' . $article_thumbnail_ext; $oldmask = umask(0); $insert = false; if ($dir = @opendir(PHPWCMS_STORAGE) && copy($article_thumbnail, $article_thumbnail_store)) { if ($article_thumbnail_size = filesize($article_thumbnail_store)) { // yeah, we have it $data = array('f_pid' => $feedimport_result['cnt_object']['image_folder_id'], 'f_uid' => $feedimport_result['cnt_object']['author_id'], 'f_kid' => 1, 'f_aktiv' => 1, 'f_public' => 1, 'f_name' => $article_thumbnail_name, 'f_created' => now(), 'f_size' => $article_thumbnail_size, 'f_type' => get_mimetype_by_extension($article_thumbnail_ext), 'f_ext' => $article_thumbnail_ext, 'f_longinfo' => $article_title, 'f_hash' => $article_thumbnail_hash, 'f_copyright' => '', 'f_tags' => $article_categories); if (PHPWCMS_CHARSET != 'utf-8') { $data['f_name'] = makeCharsetConversion($data['f_name'], 'utf-8', PHPWCMS_CHARSET); $data['f_longinfo'] = makeCharsetConversion($data['f_longinfo'], 'utf-8', PHPWCMS_CHARSET); $data['f_copyright'] = makeCharsetConversion($data['f_copyright'], 'utf-8', PHPWCMS_CHARSET); $data['f_tags'] = makeCharsetConversion($data['f_tags'], 'utf-8', PHPWCMS_CHARSET); } $insert = _dbInsert('phpwcms_file', $data); if (isset($insert['INSERT_ID'])) { $feedimport_result['image']['name'] = $article_thumbnail_name; $feedimport_result['image']['id'] = $insert['INSERT_ID']; $feedimport_result['image']['width'] = $phpwcms["content_width"]; $feedimport_result['image']['height'] = ''; $feedimport_result['image']['hash'] = $article_thumbnail_hash; $feedimport_result['image']['ext'] = $article_thumbnail_ext; $feedimport_result['image']['list_usesummary'] = 1; } } if (!$feedimport_result['image']['id'] && is_file($article_thumbnail_store)) { unlink($article_thumbnail_store); }
if ($check_anzahl["anzahl"]) { $user_err .= $BL['be_admin_usr_err1'] . "\n"; } } mysql_free_result($result); } } if (isEmpty($new_password)) { $user_err .= $BL['be_admin_usr_err3'] . "\n"; } if (!is_valid_email($new_email) && $send_verification) { $user_err .= $BL['be_admin_usr_err4'] . "\n"; } if (empty($user_err)) { //Insert new User $sql = "INSERT INTO " . DB_PREPEND . "phpwcms_user (usr_login, usr_pass, usr_email, " . "usr_admin, usr_aktiv, usr_name, usr_wysiwyg, usr_fe ) VALUES ('" . aporeplace($new_login) . "', '" . aporeplace(md5(makeCharsetConversion($new_password, PHPWCMS_CHARSET, 'utf-8'))) . "', '" . aporeplace($new_email) . "', '" . $set_user_admin . "', '" . $set_user_aktiv . "', '" . aporeplace($new_name) . "', 1, '" . $set_user_fe . "')"; if (mysql_query($sql, $db) or die('error while creating new user')) { $new_user_id = mysql_insert_id($db); $user_ok = 1; if ($send_verification) { $emailbody = str_replace('{LOGIN}', $new_login, $BL['be_admin_usr_mailbody']); $emailbody = str_replace('{PASSWORD}', $new_password, $emailbody); $emailbody = str_replace('{SITE}', PHPWCMS_URL, $emailbody); $emailbody = str_replace('{LOGIN_PAGE}', PHPWCMS_URL . get_login_file(), $emailbody); sendEmail(array('recipient' => $new_email, 'toName' => $new_name, 'subject' => $BL['be_admin_usr_mailsubject'], 'isHTML' => 0, 'text' => $emailbody, 'from' => $phpwcms["admin_email"], 'sender' => $phpwcms["admin_email"])); } } } } if (empty($user_ok)) { ?>
/** * Convert internationalized domain names * * @param string * @return string */ function idn_encode($string = '') { if (IS_PHP5) { require_once PHPWCMS_ROOT . '/include/inc_ext/idna_convert/idna_convert.class.php'; } // convert to utf-8 first $string = makeCharsetConversion($string, PHPWCMS_CHARSET, 'utf-8'); // include punicode conversion if >= PHP5 if (empty($string) || !class_exists('idna_convert')) { return $string; } $IDN = new idna_convert(); return $IDN->encode($string); }
/** * Check referrer string for search engine related information * and log those fetched data in database * Basic idea: http://www.tellinya.com/read/2007/07/11/34.html * * @return array * @param string referrer string * **/ function seReferrer($ref = false) { if (!empty($ref) && is_string($ref)) { $SeReferer = trim($ref); } elseif (isset($_SERVER['HTTP_REFERER'])) { $SeReferer = trim($_SERVER['HTTP_REFERER']); } else { return false; } $SePos = 0; $SeDomain = ''; //Check against Google, Yahoo, MSN, Ask and others if ($SeReferer && preg_match('/[&\\?](q|p|w|s|qry|searchfor|as_q|as_epq|query|qt|keyword|keywords|encquery)=([^&]+)/i', $SeReferer, $pcs)) { if (preg_match("/https?:\\/\\/([^\\/]+)\\//i", $SeReferer, $SeDomain)) { $SeDomain = trim(strtolower($SeDomain[1])); $SeQuery = $pcs[2]; if (preg_match("/[&\\?](start|b|first|stq)=([0-9]*)/i", $SeReferer, $pcs)) { $SePos = (int) trim($pcs[2]); } } } if (!isset($SeQuery)) { //Check against DogPile if (preg_match('/\\/search\\/web\\/([^\\/]+)\\//i', $SeReferer, $pcs)) { if (preg_match("/https?:\\/\\/([^\\/]+)\\//i", $SeReferer, $SeDomain)) { $SeDomain = trim(strtolower($SeDomain[1])); $SeQuery = $pcs[1]; } } // We Do Not have a query if (!isset($SeQuery)) { return false; } } $OldQ = $SeQuery; $SeQuery = urldecode($SeQuery); // The Multiple URLDecode Trick to fix DogPile %XXXX Encodes while ($SeQuery != $OldQ) { $OldQ = $SeQuery; $SeQuery = urldecode($SeQuery); } // check given query and decode utf-8 if (PHPWCMS_CHARSET != 'utf-8' && phpwcms_seems_utf8($SeQuery)) { $SeQuery = makeCharsetConversion($SeQuery, 'utf-8', PHPWCMS_CHARSET, false); } return array("domain" => $SeDomain, "query" => $SeQuery, "pos" => $SePos, "referrer" => $SeReferer); }
function include_url($url) { // include given URL but only take content between <body></body> global $include_urlparts; if (is_string($url)) { $url = array(1 => $url); } elseif (!isset($url[1])) { return ''; } $k = ''; $url = trim($url[1]); $url = explode(' ', $url); $cache = isset($url[1]) ? intval(str_replace('CACHE=', '', strtoupper($url[1]))) : 0; $url = $url[0]; $cache_status = 'MISSING'; if ($url && $cache) { $cache_filename = md5($url) . '-url'; // set cache file name $cache_file = PHPWCMS_CONTENT . 'tmp/' . $cache_filename; // set caching file $cache_status = check_cache($cache_file, $cache); // ceck existence if ($cache_status == 'VALID') { // read cache $k = read_textfile($cache_file); $k = trim($k); if (empty($k)) { $cache_status == 'EXPIRED'; // check if cache content is available } } } if ($cache_status != 'VALID' && $url) { // cache file is missing or outdated $include_urlparts = parse_url($url); if (!empty($include_urlparts['path'])) { $include_urlparts['path'] = dirname($include_urlparts['path']); $include_urlparts['path'] = str_replace('\\', '/', $include_urlparts['path']); } $k = @file_get_contents($url); if ($k) { // now check against charset if (preg_match('/charset=(.*?)"/i', $k, $match)) { $charset = $match[1]; $charset = str_replace(array('"', "'", '/'), '', $charset); $charset = strtolower(trim($charset)); } elseif (preg_match('/http-equiv="{0,1}Content-Type"{0,1}\\s{1,}(content="{0,1}.*?"{0,1}.{0,3}>)/i', $k, $match)) { $charset = ''; if (!empty($match[1])) { $charset = strtolower($match[1]); $charset = trim(str_replace(array('"', "'", '/', 'content=', ' ', '>'), '', $charset)); } } else { $charset = false; } if (preg_match('/<body[^>]*?' . '>(.*)<\\/body>/is', $k, $match)) { $k = $match[1]; } $k = str_replace(array('<?', '?>', '<%', '%>'), array('<?', '?>', '<%', '%>'), $k); $k = preg_replace_callback('/(href|src|action)=[\'|"]{0,1}(.*?)[\'|"]{0,1}( .*?){0,1}>/i', 'make_absoluteURL', $k); $k = htmlfilter_sanitize(trim($k), array(false, 'link', 'meta'), array(), array('img', 'br', 'hr', 'input'), true); if ($charset != false) { $k = makeCharsetConversion($k, $charset, PHPWCMS_CHARSET, 1); } // now write or update cache file in case there is timeout or content if ($cache && $k) { @write_textfile($cache_file, $k); } } $include_urlparts = ''; } return $k; }
} else { $user_var['selected_cp'] = array(); foreach ($_POST['profile_account_cp'] as $cp) { $cp = intval($cp); $user_var['selected_cp'][$cp] = $cp; } } } else { $user_var['selected_cp'] = array(); } //Jetzt die Daten aktualisieren if (empty($err)) { $sql = "UPDATE " . DB_PREPEND . "phpwcms_user SET "; $sql .= " usr_login="******", "; if (!empty($new_password)) { $sql .= "usr_pass="******", "; } $sql .= "usr_email=" . _dbEscape($new_email); $sql .= ", usr_lang=" . _dbEscape($new_language); $sql .= ", usr_wysiwyg=" . $new_wysiwyg; $sql .= " , usr_vars=" . _dbEscape(serialize($user_var)); $sql .= " WHERE usr_id=" . $_SESSION["wcs_user_id"]; $sql .= " AND usr_login='******' LIMIT 1"; if (mysql_query($sql, $db)) { //Wenn Aktualisierung erfolgreich war //neue Werte den Sessionvariablen zuweisen $_SESSION["wcs_user"] = $new_username; $_SESSION["wcs_user_email"] = $new_email; $_SESSION["wcs_user_lang"] = $new_language; $_SESSION["WYSIWYG_EDITOR"] = $new_wysiwyg; //$_SESSION["WYSIWYG_TEMPLATE"] = $user_var['template'];
$row_count = 0; $sql = 'SELECT *, COUNT(*) AS occurance FROM ' . DB_PREPEND . 'phpwcms_log_seo '; if ($_entry['query']) { $sql .= 'WHERE ' . $_entry['query'] . ' '; } $sql .= 'GROUP BY hash ORDER BY occurance DESC '; $sql .= 'LIMIT ' . ($_SESSION['seolog_page'] - 1) * $_SESSION['list_user_count'] . ',' . $_SESSION['list_user_count']; $data = _dbQuery($sql); if ($data) { foreach ($data as $row) { echo '<tr' . ($row_count % 2 ? ' bgcolor="#F3F5F8"' : '') . '>'; echo '<td class="tdbottom3 tdtop3" align="center"> '; echo $row['occurance']; echo ' </td>'; echo '<td class="tdbottom3 tdtop3"><a href="'; echo html($row['referrer']) . '" target="_blank">' . html($row['domain']); echo '</a></td>'; echo '<td class="tdbottom3 tdtop3">'; echo html(PHPWCMS_CHARSET != 'utf-8' && phpwcms_seems_utf8($row['query']) ? makeCharsetConversion($row['query'], 'utf-8', PHPWCMS_CHARSET, false) : $row['query']); echo '</td>'; echo "</tr>\n"; $row_count++; } echo '<tr><td colspan="3" bgcolor="#92A1AF"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>'; } else { echo '<tr><td colspan="3" class="tdtop5">' . $BL['be_empty_search_result'] . '</td></tr>'; } ?> <tr><td colspan="3"><img src="img/leer.gif" alt="" width="1" height="15"></td></tr> </table>
function combinedParser($string, $charset = 'utf-8', $allowed_tags = '') { $string = html_parser($string); $string = clean_replacement_tags($string, $allowed_tags); $string = str_replace(' ', ' ', $string); $string = decode_entities($string); $string = cleanUpSpecialHtmlEntities($string); if (!empty($string) && PHPWCMS_CHARSET != $charset) { $string = makeCharsetConversion($string, PHPWCMS_CHARSET, $charset); } else { $string = html_specialchars($string); } // Strip away unwanted UTF-8 chars to avoid XML fatal parsing error // http://www.phpwact.org/php/i18n/charsets#common_problem_areas_with_utf-8 if ($charset == 'utf-8') { $string = preg_replace('/[^\\x{0009}\\x{000a}\\x{000d}\\x{0020}-\\x{D7FF}\\x{E000}-\\x{FFFD}]+/u', ' ', $string); } return $string; }
if (!is_array($set_user_var)) { $set_user_var = array(); } $set_user_var['allowed_cp'] = $set_allowed_cp; } } } } if (!is_valid_email($new_email)) { $user_err .= $BL['be_admin_usr_err4'] . "\n"; } if (empty($user_err)) { //Insert new User $sql = "UPDATE " . DB_PREPEND . "phpwcms_user SET usr_login='******', "; if ($new_password) { $sql .= "usr_pass='******'utf-8'))) . "', "; } $sql .= "usr_email='" . aporeplace($new_email) . "', " . "usr_admin='" . $set_user_admin . "', " . "usr_aktiv='" . $set_user_aktiv . "', " . "usr_name='" . aporeplace($new_name) . "', "; if (isset($set_user_var['allowed_cp'])) { $sql .= "usr_vars=" . _dbEscape(serialize($set_user_var)) . ", "; } $sql .= "usr_fe='" . $set_user_fe . "' WHERE usr_id=" . $new_user_id; if ($result = mysql_query($sql, $db) or die("error")) { $user_ok = 1; $new_user_id = NULL; if ($send_verification) { $emailbody = str_replace('{LOGIN}', $new_login, $BL['be_admin_usr_emailbody']); $emailbody = str_replace('{PASSWORD}', $new_password ? $new_password : $BL['be_admin_usr_passnochange'], $emailbody); $emailbody = str_replace('{SITE}', PHPWCMS_URL, $emailbody); $emailbody = str_replace('{LOGIN_PAGE}', PHPWCMS_URL . get_login_file(), $emailbody); sendEmail(array('recipient' => $new_email, 'toName' => $new_name, 'subject' => $BL['be_admin_usr_mailsubject'], 'isHTML' => 0, 'text' => $emailbody, 'from' => $phpwcms["admin_email"], 'sender' => $phpwcms["admin_email"]));
?> ", minSizeError: "<?php echo makeCharsetConversion($BL['be_fileuploader_minSizeError'], 'utf-8', PHPWCMS_CHARSET); ?> ", emptyError: "<?php echo makeCharsetConversion($BL['be_fileuploader_emptyError'], 'utf-8', PHPWCMS_CHARSET); ?> ", noFilesError: "<?php echo makeCharsetConversion($BL['be_fileuploader_noFilesError'], 'utf-8', PHPWCMS_CHARSET); ?> ", onLeave: "<?php echo makeCharsetConversion($BL['be_fileuploader_onLeave'], 'utf-8', PHPWCMS_CHARSET); ?> " }, disableDefaultDropzone: false, onSubmit: function(id, fileName) { uploadFileCount++; }, onCancel: function(id, fileName) { uploadFileCount--; }, onComplete: function(id, fileName, responseJSON) { if(responseJSON.success) { uploadFileCount--; if(uploadFileCount == 0) { document.location.reload(true);