Skip to content

Commit

Permalink
fix warnings: unresolved variables
Browse files Browse the repository at this point in the history
  • Loading branch information
herrvigg committed Dec 11, 2018
1 parent c69c129 commit aeb9231
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
1 change: 0 additions & 1 deletion admin/qtx_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ function qtranxf_collect_translations_posted() {
if ( strpos( $val, 'qtranslate-fields' ) === false ) {
continue;
}
$r;
parse_str( $val, $r );
//qtranxf_dbg_log('qtranxf_collect_translations_posted: REQUEST['.$nm.'] $r: ', $r);
//qtranxf_dbg_log('qtranxf_collect_translations_posted: REQUEST['.$nm.']: ', $val);
Expand Down
2 changes: 1 addition & 1 deletion admin/qtx_admin_utils_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ function gtranxf_db_clean_terms() {
$errs = array( __( 'Term configuration is inconsistent.', 'qtranslate' ) );
}
//qtranxf_dbg_log('gtranxf_db_clean_terms: invalid term $id='.$id.', name='.$nm.' Error:', $errs);
$messages[] = sprintf( __( 'Term "%s" (id=%d) cannot be loaded and is left untouched. Error message on load was:%s', 'qtranslate' ), $nm, $id, '<br/>' . PHP_EOL . '"' . implode( '"<br/>"' . PHP_EOL, $errs ) . '"' ) . '<br/>' . $msg;
$messages[] = sprintf( __( 'Term "%s" (id=%d) cannot be loaded and is left untouched. Error message on load was:%s', 'qtranslate' ), $nm, $id, '<br/>' . PHP_EOL . '"' . implode( '"<br/>"' . PHP_EOL, $errs ) . '"' ) . '<br/>';
continue;
} else {
$taxonomy = $term->taxonomy;
Expand Down
3 changes: 2 additions & 1 deletion admin/qtx_update_gettext_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function qtranxf_updateGettextDatabasesEx( $force = false, $only_for_language =
require_once ABSPATH . 'wp-admin/includes/translation-install.php';
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
require_once ABSPATH . 'wp-admin/includes/file.php';
include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
$wp_version = '';
include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version - not sure why we need this?!
$result = translations_api( 'core', array( 'version' => $wp_version ) );

if ( is_wp_error( $result ) ) {
Expand Down
1 change: 0 additions & 1 deletion qtranslate_frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ function qtranxf_translate_option( $value, $lang = null ) {
*/
function qtranxf_filter_options() {
global $q_config, $wpdb;
$where;
switch ( $q_config['filter_options_mode'] ) {
case QTX_FILTER_OPTIONS_ALL:
$where = ' WHERE autoload=\'yes\' AND (option_value LIKE \'%![:__!]%\' ESCAPE \'!\' OR option_value LIKE \'%{:__}%\' OR option_value LIKE \'%<!--:__-->%\')';
Expand Down
19 changes: 7 additions & 12 deletions qtranslate_utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,25 +412,21 @@ function qtranxf_add_query_arg( &$query, $key_value ) {
* @since 3.2.8
*/
function qtranxf_del_query_arg( &$query, $key ) {
//$key_value;
$match;
while ( preg_match( '/(&|&amp;|&#038;|^)(' . $key . '=[^&]+)(&|&amp;|&#038;|$)/i', $query, $match ) ) {
//$key_value = $match[2];
$p = strpos( $query, $match[2] );
$n = strlen( $match[2] );
if ( ! empty( $match[1] ) ) {
$l = strlen( $match[1] );
while ( preg_match( '/(&|&amp;|&#038;|^)(' . $key . '=[^&]+)(&|&amp;|&#038;|$)/i', $query, $matches ) ) {
$p = strpos( $query, $matches[2] );
$n = strlen( $matches[2] );
if ( ! empty( $matches[1] ) ) {
$l = strlen( $matches[1] );
$p -= $l;
$n += $l;
} elseif ( ! empty( $match[3] ) ) {
$l = strlen( $match[3] );
} elseif ( ! empty( $matches[3] ) ) {
$l = strlen( $matches[3] );
$n += $l;
}
//qtranxf_dbg_log('qtranxf_del_query_arg: query: '.$query.'; p='.$p.'; n=',$n);
$query = substr_replace( $query, '', $p, $n );
//qtranxf_dbg_log('qtranxf_del_query_arg: query: ',$query);
}
//return $key_value;
}

/*
Expand All @@ -439,7 +435,6 @@ function qtranxf_del_query_arg( &$query, $key ) {
function qtranxf_sanitize_url( $url ) {
$url = preg_replace( '|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url );
$strip = array( '%0d', '%0a', '%0D', '%0A' );
$count;
do {
$url = str_replace( $strip, '', $url, $count );
} while ( $count );
Expand Down

0 comments on commit aeb9231

Please sign in to comment.