Plugin Directory

Changeset 3419763


Ignore:
Timestamp:
12/15/2025 07:49:46 AM (2 months ago)
Author:
audiotyped
Message:

Release 1.4.6 - Normalize speaker names to ensure reliable transcript parsing

Location:
audiotyped-ux/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • audiotyped-ux/trunk/audiotyped-ux.php

    r3419284 r3419763  
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010Text Domain: audiotyped-ux
    11 Version: 1.4.5
     11Version: 1.4.6
    1212*/
    1313
    14 define( 'AUDIOTYPED_UX_VERSION', '1.4.5' );
     14define( 'AUDIOTYPED_UX_VERSION', '1.4.6' );
    1515
    1616function audiotyped_ux_defaults() {
     
    6666  $file_url  = plugin_dir_url( __FILE__ ) . $relative_path;
    6767
    68   $version = defined( 'AUDIOTYPED_UX_VERSION' ) ? AUDIOTYPED_UX_VERSION : '1.4.5';
     68  $version = defined( 'AUDIOTYPED_UX_VERSION' ) ? AUDIOTYPED_UX_VERSION : '1.4.6';
    6969  if ( file_exists( $file_path ) ) {
    7070      $version = filemtime( $file_path );
     
    912912}
    913913
     914function audiotyped_normalize_speaker_name( $name ) {
     915    $name = sanitize_text_field( wp_unslash( $name ) );
     916    $name = trim( $name );
     917
     918    // Remove one or multiple trailing colons (incl. optional whitespace):
     919    $name = preg_replace( '/\s*:+\s*$/u', '', $name );
     920
     921    // Collapse multiple spaces into a single space
     922    $name = preg_replace( '/\s+/u', ' ', $name );
     923
     924    return $name;
     925}
     926
    914927function audiotyped_transcriptux_transcript_html_tab() {
    915928  $transcript      = '';
     
    933946
    934947      $host_name = isset( $_POST['audiotyped_host_name'] )
    935           ? sanitize_text_field( wp_unslash( $_POST['audiotyped_host_name'] ) )
     948          ? audiotyped_normalize_speaker_name( $_POST['audiotyped_host_name'] )
     949        : '';
     950
     951      $guest_name = isset( $_POST['audiotyped_guest_name'] )
     952          ? audiotyped_normalize_speaker_name( $_POST['audiotyped_guest_name'] )
    936953          : '';
    937954
    938       $guest_name = isset( $_POST['audiotyped_guest_name'] )
    939           ? sanitize_text_field( wp_unslash( $_POST['audiotyped_guest_name'] ) )
    940           : '';
    941 
    942       // NEU: Guest 2 Name (optional)
    943955      $guest2_name = isset( $_POST['audiotyped_guest2_name'] )
    944           ? sanitize_text_field( wp_unslash( $_POST['audiotyped_guest2_name'] ) )
     956          ? audiotyped_normalize_speaker_name( $_POST['audiotyped_guest2_name'] )
    945957          : '';
    946958
     
    10601072   */
    10611073  function audiotyped_transcriptux_generate_html( $transcript, $host_name, $guest_name, $host_img, $guest_img, $guest2_name = '', $guest2_img = '' ) {
     1074      $host_name   = audiotyped_normalize_speaker_name( $host_name );
     1075      $guest_name  = audiotyped_normalize_speaker_name( $guest_name );
     1076      $guest2_name = audiotyped_normalize_speaker_name( $guest2_name );
    10621077      $host_img   = esc_url( $host_img );
    10631078      $guest_img  = esc_url( $guest_img );
  • audiotyped-ux/trunk/readme.txt

    r3419284 r3419763  
    44Requires at least: 5.4.2
    55Tested up to: 6.9
    6 Stable tag: 1.4.5
     6Stable tag: 1.4.6
    77Requires PHP: 7.0
    88License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.