permalinks – How to keep WP from creating a “single-post” page and let the user input the link of the post in the dashboard?

I have this very specific questions. On my homepage I decided to show excerpts of the latest news and events with a “while” loop.
The issue is that I want the admin to define what the permalink will be of said post, and not have a /event/lorem-ipsum page for each event. The idea is to link those excerpts to Instagram posts, Facebook posts, or whatever…

My custom_post_type function is:

register_post_type('event', 
    array(
        'rewrite' => array('slug' => 'events'),
        'labels' => array(
            'name' => 'Events',
            'singular_name' => 'Event',
            'adding_new_item' => 'Add event',
            'edit_item' => 'Edit event'
        ),
        'menu-icon' => 'dashicons-calendar-alt',
        'public' => true,
        'has_archive' => true,
        'supports' => array(
            'title', 'thumbnail', 'editor', 
        )
    )
);

appsec – Is it a serious security issue if a software crashes on much larger than expected input data?

Background: The software in question is a purpose built mapping system designed originally for Windows XP, but is currently run without any major issues on Windows 10. It can be run locally or by logging into our servers through a built-in UI, but only from registered IP addresses. I do not know what language the software was written in (we think .NET), the devs/maintainers have long since left.

Problem: The software has an option to submit some data as a file or by filling it in a textbox. The issue is that software hard crashes if someone provides too large a list in that textbox (roughly greater than 8200 lines). It also crashes if the data in the text file is large, but the limit there is much higher (seems to be around 750 MB).

It does not give any reason for the crash, but Windows Event Viewer says:

Description: The process was terminated due to an unhandled exception.
Exception Info: exception code c0000005, exception address 00007FF7BBD6943E

The exception address is occasionally just zeroes and other times an actual memory address.

I’ve tried to get the error after launching the software from the terminal, but it still does not give any error message. The crash is the same whether the software is run locally or server-side.

I know that buffer overflows are a major point of vulnerability, but I’m not sure that is what is happening here, or if it is some sort of UI failure, or what.

Question: Should I be concerned about this as a major security issue?

I’m inclined to not be, considering this is fairly obscure piece of software that is probably used by less than 10 people over the world and probably all of them are in the same department. Plus, the fact that only people whose IPs are registered into the software can run it server-side. But I would appreciate some outside advice.

python – Como usar o pop dentro de um input

Galera to tentando fazer um programinha de carrinho de compras, so que quando eu dou o comando remover ele remove o item que eu pedi e tambem mostra que o item nao foi encontrado, sendo que so ele pra ele mostrar que o item nao foi encontrado se o numero que eu digitei nao estiver la ex:’O item {que voce digitou} nao foi encontrado’, to tentando fazer com o pop.

n = input(‘Numeros: ‘).split()

lista = list(n)

while True:
comando = input(‘Comando : ‘)

if comando == 'exibir':
    lista.sort()
    print(lista)
if comando == 'adicionar':
    lista.append(input())
if comando == 'remover':
    x = lista.pop(eval((input())))
if x not in lista:
    print('código {} não encontrado'.format(x))
else:
    print(lista)
if comando == 'terminate':
    break

print(lista)

java – input month name correspond to the number and dectect if it correct or not

I want my program result to be like this

Month 9: July
wrong

where 9 is the random number using random and July is the input using scanner
I did something wrong and my code does not work, please help me solve it
Here is my code

import java.util.Random;
import java.util.Scanner;

public class check {

    public static void main(String() args) {
        // TODO Auto-generated method stub
    
    Random rand = new Random();
    Scanner stdIn = new Scanner(System.in);
    String () monthString = {"January"+"Febuary"+"March"+"April"+"May"+"June"+"July"+"August"+"September"+"October"+"November"+"December"};
    
    int num = 1+ rand.nextInt(12);
    
    System.out.print("Month"+":");
    System.out.print(num);
    
    int n = 0;
    if (n >= 1 && n <= 12) {
        System.out.format("The name of month number %d is %sn", n, monthString(n-1));
    while(true) {
        String month = stdIn.next();
    
        
    if(num==n)break;
        System.out.println("wrong");
    }
    System.out.println("right");
    }
    }
    
}

Calendário Python sem Import apenas usando input e condições

Alguém pode pfvr me dar uma ajuda não estou conseguindo resolver esse problema preciso fazer em python usando condições
Faça um programa que leia três valores inteiros: dia,
mês e ano de uma data e visualize a data por extenso,
validando (visualize uma mensagem se os dados estão
errados) se o dia está entre 1 e 31 e o mês entre 1 e 12,
sem diferenciar os meses que têm menos de 31 dias.
• Exemplos:
– 26/03/2015 → 26 de março de 2015
– 32/05/2015 → Dia incorreto
– 15/13/2015 → Mês incorreto

javascript – Acceder a la informacion de un input dentro de una tabla con $(this).parents

Tengo una tabla html, y por cada registro se tiene un boton, unos datos planos y un input.
cuando se presiona el boton, quisiera poder capturar el dato del input que se encuentra en otra columna.
pero no he podido lograrlo.

tengo un metodo asi:

 function metodo(obj)
        {
        
        //var id2 = $(this).parents("tr").find("td");
        //var data = $(obj).parents("tr").find("number").value;
        var data = $(this).parents("tr").find("number").value;
        console.log(data);
        
        }

He puesto un ejemplo completo aqui:

https://jsfiddle.net/dzsmk81f/1/

lo que pasa es que no entiendo muy bien el uso de parents, para acceder a los atributos que contiene, si alguien maneja bien este tema y me puede ayudar, se lo agradeceria mucho.
gracias.

php – ¿Cómo puedo hacer el envió de un formulario que tiene dos input tipo FILE?

necesito enviar este formulario con PHP dentro del formulario constan dos inputs tipo file el uno lo uso para enviar un documento obligatorio, el otro en caso de que activen el botón de enviar otro documento se abre ese input file.
En el archivo PHP que tengo solo funciona y me llega perfectamente el primer archivo pero no se como hacer para enviar el otro intente de la forma que adjunto pero no se que estoy realizando mal o que necesito hacer para poder enviar esos dos input tipo FILE.

FORM.HTML

<form action="envio.php" id="formulario" method="post" enctype="multipart/form-data">
        <fieldset>
        <h2 class="titulo">Envío de documentos</h2>
        <h3 class="subtitulo">
          Todos los campos marcados con (*) son obligatorios
          si no los llenas no podrás enviar el formulario.
        </h3>

        <input type="text" id="idd" name="idd" hidden>

        <p>N° Documento</p>
        <input
          type="text"
          name="idDocumento"
          id="idDocumento"
          style="background-color: #dfdfdf;"
          readonly='readonly'
        />
  

        <p>(*) Nombres:</p>
        <p id="p_nombre"></p>
        <input
          type="text"
          name="nombres"
          placeholder="Ej. David Alexander"
          required
        />

        <p>(*) Apellidos:</p>
        <p id="p_apellidos"></p>
        <input
          type="text"
          name="apellidos"
          placeholder="Ej. Banda Llanganate"
          required
        />

        <p>(*) Cédula:<div id="salida"></div></p>
        <p id="p_cedula"></p>
        <input
          type="text"
          name="cedula"
          placeholder="Ej. 050xxxxxxx"
          id="ced"
          onchange="validarCed()"
          required
        />

        <p>(*) Cantón:</p>
        <div class="form-group">                                               
              <select name="Canton" id="Canton"  data-placeholder="- Seleccione un cantón -"
               class="form-control chosenCanton" onchange="change(this.id, 'parroquia')"
               value="<%= typeof Canton != 'undefined' ? Canton : '' %>" required>
                <option value=""></option>
                <option value="La Mana">La Maná</option>
               <option value="Latacunga">Latacunga</option>
               <option value="Pangua">Pangua</option>
               <option value="Pujilí">Pujilí</option>
               <option value="Salcedo">Salcedo</option>
               <option value="Saquisili">Saquisilí</option>
               <option value="Sigchos">Sigchos</option>
              </select>
        </div>

        <p>(*) Parroquias:</p>
        <div class="form-group">
            <select id="parroquia" name="Parroquia" data-placeholder="- Seleccione una parroquia -"
            class="form-control chosenParroquia" value="<%= typeof Parroquia != 'undefined' ? Parroquia : '' %>" required>
              <option value=""></option>
            </select>
        </div>

        <p>(*) Barrio/Comunidad/Recinto:</p>
        <p id="p_barrio"></p>
        <input
          type="text"
          name="barrio"
          placeholder="Ej. Centro"
          required
        /> 

        <p>(*) Dirección Calles:</p>
        <p id="p_direccion"></p>
        <input
          type="text"
          name="direccion"
          placeholder="Ej. Calle Juan Manuel Lasso"
          required
        /> 

        <p>(*) Teléfono Celular:</p>
        <p id="p_t_celular"></p>
        <input
          type="text"
          name="t_celular"
          value="09"
          placeholder="Ej. 09xxxxxxxx"
          required
        /> 

        <p>Teléfono Convencional:</p>
        <p id="p_t_convencional"></p>
        <input
          type="text"
          name="t_convencional"
          id="t_convencional"
          value="03"
          onchange="validarTC()"
          placeholder="Ej. 032xxxxxx"
        />

        <p>(*) Tipo de persona:</p>
        <select name="tipo_persona" class="tipo_persona" required>
          <option value="opcion" selected>Seleccione el tipo de persona...</option>
          <option value="Persona Natural">Persona Natural</option>
          <option value="Persona Jurídica de Derecho Privado">Persona Jurídica de Derecho Privado</option>
          <option value="Persona Jurídica de Derecho Público">Persona Jurídica de Derecho Público</option>
        </select>
        <br>

        <p>(*) Correo Electrónico:</p>
        <p id="p_email"></p>
        <input
          type="email"
          name="email"
          placeholder="Ej. user@example.com"
          required
        />

        <p>(*) Petición Concreta:</p>
        <!--<input
          type="textarea"
          name="desc"
          placeholder="Documento para..."
          required
        />-->

        <textarea name="desc" id="desc" cols="30" rows="5" placeholder="Documento para..." required></textarea>

        <p>(*) Archivo Digital PDF:</p>
        <p id="p_file"></p>
        <input
          type="file"
          name="file"
          id="archivoInput"
          onchange="return validarExt()"
          required
        />

        <p>(*) ¿Tiene un archivo adjunto?</p>
        <div id="checkbox">
          <div id="sidiv">
            <span>Si</span><input type="radio" name="si" value="Si" id="si" onclick="ver()"><br>
          </div>
          <div id="nodiv">
            <span>No</span><input type="radio" name="no" value="No" id="no" checked onclick="ocultar()"><br>
          </div>
          
          
        </div>

        
        <div id="show" style="display: none;">
          <p>(*) Archivo Adjunto PDF:</p>
          <p id="p_file2"></p>
          <input
            type="file"
            name="file2"
            id="archivoInput2"
            onchange="return validarExt2()"
          />
        </div>
        

        <input
          type="submit"
          name="next"
          class="next action-button"
          value="Enviar"
          id="btnsubmit"
        />

        <p id="mensaje"></p>
        <p id="mensaje_telefono_con"></p>
       <div id="visorArchivo"></div>
       <div id="visorArchivoAdjunto"></div>
      </fieldset>
      <br />
      <br />
      
    </form>

ENVIO.PHP

<?php

// variables del formulario
    $NDocumento = $_POST('idDocumento');
    $nombres = strip_tags($_POST('nombres'));
    $apellidos = strip_tags($_POST('apellidos'));
    $cedula = strip_tags($_POST('cedula'));
    $Canton = strip_tags($_POST('Canton'));
    $Parroquia = strip_tags($_POST('Parroquia'));
    $barrio = strip_tags($_POST('barrio'));
    $direccion = strip_tags($_POST('direccion'));
    $t_celular = strip_tags($_POST('t_celular'));
    $t_convencional = strip_tags($_POST('t_convencional'));
    $tipo_persona = strip_tags($_POST('tipo_persona'));
    $email = strip_tags($_POST('email'));
    $desc = strip_tags($_POST('desc'));

    $asunto2 = 'RECEPCIÓN EXTERNA';

    //ARCHIVO
    $nameFile = $_FILES('file')('name');
    $sizeFile = $_FILES('file')('size');
    $typeFile = $_FILES('file')('type');
    $tempFile = $_FILES('file')('tmp_name');
    

    $fecha= time();
    $fechaFormato = date("j/n/Y",$fecha);

    $correoDestino = "user@example.com";
    
    //asunto del correo
    $asunto = "Nuevo documento de: " . $nombres;

    
    // -> mensaje en formato Multipart MIME
    $cabecera = "MIME-VERSION: 1.0rn";
    $cabecera .= "Content-type: multipart/mixed;";
    //$cabecera .="boundary='=P=A=L=A=B=R=A=Q=U=E=G=U=S=T=E=N='"
    $cabecera .="boundary="=C=T=E=C="rn";
    $cabecera .= "From: RECEPCIÓN EXTERNA<{$email}>";

    //Primera parte del cuerpo del mensaje
    $cuerpo = "--=C=T=E=C=rn";
    $cuerpo .= "Content-Type: text/plain; charset=ISO-8859-1rn";
    //cuerpo .= "charset=utf-8rn";
    //$cuerpo .= "Content-Transfer-Encoding: 8bitrn";
    $cuerpo .= "rn"; // línea vacía
    $cuerpo .= "Correo enviado por: " . $nombres;
    $cuerpo .= " con fecha: " . $fechaFormato . "rn";
    $cuerpo .= "N Documento: " . $NDocumento . "rn";
    $cuerpo .= "Nombres: " . $nombres . "rn";
    $cuerpo .= "Apellidos: " . $apellidos . "rn";
    $cuerpo .= "Cédula: " . $cedula . "rn";
    $cuerpo .= "Cantón: " . $Canton . "rn";
    $cuerpo .= "Parroquia: " . $Parroquia . "rn";
    $cuerpo .= "Barrio: " . $barrio . "rn";
    $cuerpo .= "Dirección: " . $direccion . "rn";
    $cuerpo .= "Celular: " . $t_celular . "rn";
    $cuerpo .= "Covencional: " . $t_convencional . "rn";
    $cuerpo .= "Tipo de persona: " . $tipo_persona . "rn";
    $cuerpo .= "Correo: " . $email . "rn";
    $cuerpo .= "Petición concreta: " . $desc . "rn";
    $cuerpo .= "rn";// línea vacía

    // -> segunda parte del mensaje (archivo adjunto)
        //    -> encabezado de la parte
    $cuerpo .= "--=C=T=E=C=rn";
    $cuerpo .= "Content-Type: application/octet-stream; ";
    $cuerpo .= "name=" . $nameFile . "rn";
    $cuerpo .= "Content-Transfer-Encoding: base64rn";
    $cuerpo .= "Content-Disposition: attachment; ";
    $cuerpo .= "filename=" . str_replace(' ', '',$nameFile) . "rn";  //quito los espacios en el nombre
    $cuerpo .= "rn"; // línea vacía
    
    $fp = fopen($tempFile, "rb");
    $file = fread($fp, $sizeFile);
    $file = chunk_split(base64_encode($file));
    
    $cuerpo .= "$filern";
    $cuerpo .= "rn"; // línea vacía
    // Delimitador de final del mensaje.
    $cuerpo .= "--=C=T=E=C=--rn";
    
    if (!empty($_FILES('file2'))){
        $nameFile2 = $_FILES('file2')('name');
        $sizeFile2 = $_FILES('file2')('size');
        $typeFile2 = $_FILES('file2')('type');
        $tempFile2 = $_FILES('file2')('tmp_name');
        
    }
    
    //ARCHIVO ADJUNTO 2
    $cuerpo .= "--=C=T=E=C=rn";
    $cuerpo .= "Content-Type: application/octet-stream; ";
    $cuerpo .= "name=" . $nameFile2 . "rn";
    $cuerpo .= "Content-Transfer-Encoding: base64rn";
    $cuerpo .= "Content-Disposition: attachment; ";
    $cuerpo .= "filename=" . str_replace(' ', '',$nameFile2) . "rn";  //quito los espacios en el nombre
    $cuerpo .= "rn"; // línea vacía*/
    
    //FILE2
    $fp2 = fopen($tempFile2, "rb");
    $file2 = fread($fp2, $sizeFile2);
    $file2 = chunk_split(base64_encode($file2));
    
    //FILE 2
    $cuerpo .= "$file2rn";
    $cuerpo .= "rn"; // línea vacía
    // Delimitador de final del mensaje.
    $cuerpo .= "--=C=T=E=C=--rn";
    
    
    //Enviar el correo
    if(mail($correoDestino, $asunto, $cuerpo, $cabecera)){
        echo '<script language="javascript">alert("Documento enviado con exito");window.location.href="formulario.html"</script>';
        
    }else{
        echo '<script language="javascript">alert("Documento no enviado algo fallo!");window.location.href="formulario.html"</script>';
    }

Este es hasta el momento mi progreso me llega correctamente el primer documento del primer input pero del segundo no no se que debo hacer estoy atascado en ese punto desde ya agradezco su ayuda.

html – Does adding a “title” attribute to the “label” element instead of the “input” harm accessibility?

I’m creating an HTML interface that has an input text field with a label attached. The label has a short name for the input and I want a more detailed description to appear as a popup for visual users, but also to be accessible for screen readers.

This can be done with the title attribute, but if I attach the title to the input element, it will only show when hovering over the input. If I attach it to the label element, then both the label and the input can be hovered to see the tooltip.

I am wondering if this will impact screen readers somehow, and read the title out in a way that could confuse non-visual users.

Here’s an example of the code:

<label title="Some extra details">
    Your Input:
    <input type="text" />
</label>

I haven’t found any such usage in the W3 docs, but I there was one suggestion from StackOverflow. I’m just concerned it might impact accessibility.

‘Input’ variable use within another python script

I’m attempting to use an input (a ‘character name’ for a little text game I’m writing to help myself learn Python).

Is it possible to have a user (player’s) input, of their name, as a global (or similar) variable within other scripts?

For context, I’ve made separate tabs/scripts for each “quest” and I would like to transfer the “character name” that was input in the “intro” of the game, across multiple other quest scripts within the same project. without the user having to enter their name each “quest”, also, I would need this variable to be written over each time the script starts, so the characters name can change each time the “game” runs.

I’ve been reading a lot of other answered questions but most refer to adding a variable that Isn’t “editable” to a global directory, but haven’t been able to find an answer for a variable that can be changed or amended each time the “game” has been initiated.

Also, if possible, could I have a long winded explanation of the process to achieve this? I would like to learn rather than just copy and paste the answer to achieve the result.

For info:

character_name = input("What can I call you? he asks excitedly! ")

print(f'''nPleased to meet you {character_name}.

This is the line of code that I’ve used to let the user input and create the variable character_name.

kubuntu – After input events, graphics show older version for a short while, creating a jumping effect in 21.04

Yesterday I upgraded to Kubuntu 21.04 from 20.10. Since then I have had this issue where the visuals I see seems to revert to an earlier (cached?) state for a very short while. E.g. (just observed on the previous line) I am writing wherever (console, here, …), and after having written a word or new character, I for a short while (maybe half a second), I see the state a very short while ago, e.g. before I wrote the last two letters, then gets back to actual state. This creates a rather annoying jumping effect. I have also seen it in mouse driven operations, e.g. closing an image in Twitter via the X the image disappearing, coming back, then finally properly disappearing, or sorting lists by clicking sort indicators at the top reverting sorting for a short while.

I am on a Dell Precision 5530, with Intel graphics enabled.

I am not able to google any similar experiences.