Changeset 3812534
- Timestamp:
- 11/19/2026 09:34:35 PM (37 hours ago)
- Location:
- codepeople-post-map
- Files:
-
- 79 added
- 4 edited
-
tags/1.3.1 (added)
-
tags/1.3.1/codepeople-post-map.php (added)
-
tags/1.3.1/feedback (added)
-
tags/1.3.1/feedback/cp-feedback.php (added)
-
tags/1.3.1/feedback/feedback.html (added)
-
tags/1.3.1/images (added)
-
tags/1.3.1/images/custom_post_type.jpg (added)
-
tags/1.3.1/images/icons (added)
-
tags/1.3.1/images/icons/animals.png (added)
-
tags/1.3.1/images/icons/apple.png (added)
-
tags/1.3.1/images/icons/audio.png (added)
-
tags/1.3.1/images/icons/bar.png (added)
-
tags/1.3.1/images/icons/beautifulview.png (added)
-
tags/1.3.1/images/icons/blue-pushpin.png (added)
-
tags/1.3.1/images/icons/bookstore.png (added)
-
tags/1.3.1/images/icons/bus.png (added)
-
tags/1.3.1/images/icons/castle-2.png (added)
-
tags/1.3.1/images/icons/chapel.png (added)
-
tags/1.3.1/images/icons/chicken.png (added)
-
tags/1.3.1/images/icons/cinema.png (added)
-
tags/1.3.1/images/icons/coffee.png (added)
-
tags/1.3.1/images/icons/cruiseship.png (added)
-
tags/1.3.1/images/icons/cycling.png (added)
-
tags/1.3.1/images/icons/deer.png (added)
-
tags/1.3.1/images/icons/dogpark.png (added)
-
tags/1.3.1/images/icons/dogs_leash.png (added)
-
tags/1.3.1/images/icons/family.png (added)
-
tags/1.3.1/images/icons/field.png (added)
-
tags/1.3.1/images/icons/flowers.png (added)
-
tags/1.3.1/images/icons/friends.png (added)
-
tags/1.3.1/images/icons/girlfriend.png (added)
-
tags/1.3.1/images/icons/hiking-tourism.png (added)
-
tags/1.3.1/images/icons/hiking.png (added)
-
tags/1.3.1/images/icons/home.png (added)
-
tags/1.3.1/images/icons/hotel_0star.png (added)
-
tags/1.3.1/images/icons/iceskating.png (added)
-
tags/1.3.1/images/icons/information.png (added)
-
tags/1.3.1/images/icons/jazzclub.png (added)
-
tags/1.3.1/images/icons/library.png (added)
-
tags/1.3.1/images/icons/love_date.png (added)
-
tags/1.3.1/images/icons/marker.png (added)
-
tags/1.3.1/images/icons/notvisited.png (added)
-
tags/1.3.1/images/icons/nursery.png (added)
-
tags/1.3.1/images/icons/olympicsite.png (added)
-
tags/1.3.1/images/icons/peace.png (added)
-
tags/1.3.1/images/icons/photo.png (added)
-
tags/1.3.1/images/icons/pin.png (added)
-
tags/1.3.1/images/icons/playground.png (added)
-
tags/1.3.1/images/icons/shoppingmall.png (added)
-
tags/1.3.1/images/icons/snowy.png (added)
-
tags/1.3.1/images/icons/sunny.png (added)
-
tags/1.3.1/images/icons/supermarket.png (added)
-
tags/1.3.1/images/icons/teahouse.png (added)
-
tags/1.3.1/images/icons/temple-2.png (added)
-
tags/1.3.1/images/icons/university.png (added)
-
tags/1.3.1/images/icons/watermill.png (added)
-
tags/1.3.1/images/icons/webcam.png (added)
-
tags/1.3.1/images/icons/yoga.png (added)
-
tags/1.3.1/images/icons/zoo.png (added)
-
tags/1.3.1/images/icons/zoom.png (added)
-
tags/1.3.1/images/miclogo-88x31.gif (added)
-
tags/1.3.1/images/multiple.jpg (added)
-
tags/1.3.1/images/routes.jpg (added)
-
tags/1.3.1/include (added)
-
tags/1.3.1/include/functions.php (added)
-
tags/1.3.1/js (added)
-
tags/1.3.1/js/cpm.admin.js (added)
-
tags/1.3.1/js/cpm.js (added)
-
tags/1.3.1/js/gutenberg.js (added)
-
tags/1.3.1/languages (added)
-
tags/1.3.1/languages/codepeople-post-map-es_ES.mo (added)
-
tags/1.3.1/languages/codepeople-post-map-es_ES.po (added)
-
tags/1.3.1/languages/codepeople-post-map-fr_FR.mo (added)
-
tags/1.3.1/languages/codepeople-post-map-fr_FR.po (added)
-
tags/1.3.1/readme.txt (added)
-
tags/1.3.1/styles (added)
-
tags/1.3.1/styles/cpm-admin-styles.css (added)
-
tags/1.3.1/styles/cpm-gutenberg.css (added)
-
tags/1.3.1/styles/cpm-styles.css (added)
-
trunk/codepeople-post-map.php (modified) (2 diffs)
-
trunk/include/functions.php (modified) (4 diffs)
-
trunk/js/cpm.admin.js (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
codepeople-post-map/trunk/codepeople-post-map.php
r3649081 r3812534 3 3 Plugin Name: CodePeople Post Map for Google Maps 4 4 Text Domain: codepeople-post-map 5 Version: 1.3. 05 Version: 1.3.1 6 6 Author: CodePeople 7 7 Author URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map … … 153 153 add_menu_page( 'CodePeople Post Map for Google Maps', 'CodePeople Post Map for Google Maps', 'manage_options', $slug, array(&$cpm_master_obj, 'settings_page'), 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiBmaWxsPSJjdXJyZW50Q29sb3IiPg0KICA8cGF0aCBkPSJNMTIgMmMzLjE5NiAwIDYgMi42MTggNiA1LjYwMiAwIDMuMDkzLTIuNDkzIDcuMTMyLTYgMTIuNTkxLTMuNTA3LTUuNDU5LTYtOS40OTgtNi0xMi41OTFDNiA0LjYxOCA4LjgwNCAyIDEyIDJ6bTAgNGEyIDIgMCAxIDAgMCA0IDIgMiAwIDAgMCAwLTR6Ii8+DQo8L3N2Zz4=' ); 154 154 155 add_submenu_page( $slug, 'Online Help', 'Online Help', 'read', 'google_maps_cp_help', array(&$cpm_master_obj, ' settings_page') );155 add_submenu_page( $slug, 'Online Help', 'Online Help', 'read', 'google_maps_cp_help', array(&$cpm_master_obj, 'help_page') ); 156 156 157 add_submenu_page( $slug, 'I\'ve a Question', 'I\'ve a Question', 'read', 'google_maps_cp_question', array(&$cpm_master_obj, ' settings_page') );157 add_submenu_page( $slug, 'I\'ve a Question', 'I\'ve a Question', 'read', 'google_maps_cp_question', array(&$cpm_master_obj, 'question_page') ); 158 158 159 add_submenu_page( $slug, 'Upgrade', 'Upgrade', 'read', 'google_maps_cp_upgrade', array(&$cpm_master_obj, ' settings_page') );159 add_submenu_page( $slug, 'Upgrade', 'Upgrade', 'read', 'google_maps_cp_upgrade', array(&$cpm_master_obj, 'upgrade_page') ); 160 160 } 161 161 } -
codepeople-post-map/trunk/include/functions.php
r3588032 r3812534 109 109 return wp_kses_post( $v ); 110 110 } // End sanitize_description 111 112 function sanitize_api_key( $v ) 113 { 114 if ( ! is_string( $v ) ) return ''; 115 $v = trim( $v ); 116 if ( '' === $v ) return ''; 117 // Google Maps API keys contain only letters, digits, dashes and underscores. 118 // Removing every other character guarantees the value can never carry 119 // markup into the admin JavaScript. 120 return preg_replace( '/[^A-Za-z0-9_\-]/', '', $v ); 121 } // End sanitize_api_key 111 122 112 123 //---------- CREATE MAP ---------- … … 938 949 if( !empty( $api_key ) ) 939 950 { 940 $cpm_global[ 'api_key' ] = trim($api_key);951 $cpm_global[ 'api_key' ] = $this->sanitize_api_key( $api_key ); 941 952 } 942 953 wp_localize_script('admin_cpm_script', 'cpm_global', $cpm_global); … … 993 1004 } // End load_header_resources 994 1005 1006 function help_page(){ 1007 echo("Redirecting to documentation...<script type='text/javascript'>document.location='http://wordpress.dwbooster.com/content-tools/codepeople-post-map?acode=18517';</script>"); 1008 exit; 1009 } 1010 1011 function question_page(){ 1012 echo("Redirecting to documentation...<script type='text/javascript'>document.location='https://wordpress.org/support/plugin/codepeople-post-map/#new-post';</script>"); 1013 exit; 1014 } 1015 1016 function upgrade_page(){ 1017 echo("Redirecting to upgrade page...<script type='text/javascript'>document.location='http://wordpress.dwbooster.com/content-tools/codepeople-post-map?acode=18517#download';</script>"); 1018 exit; 1019 } 1020 995 1021 /** 996 1022 * Print the settings page for entering the general setting's data of maps 997 1023 */ 998 1024 function settings_page(){ 999 if (isset($_GET["page"])) 1000 { 1001 if( $_GET["page"] == 'google_maps_cp_upgrade' ) 1002 { 1003 echo("Redirecting to upgrade page...<script type='text/javascript'>document.location='http://wordpress.dwbooster.com/content-tools/codepeople-post-map?acode=18517#download';</script>"); 1004 exit; 1005 } 1006 elseif( $_GET["page"] == 'google_maps_cp_help') 1007 { 1008 echo("Redirecting to documentation...<script type='text/javascript'>document.location='http://wordpress.dwbooster.com/content-tools/codepeople-post-map?acode=18517';</script>"); 1009 exit; 1010 } 1011 elseif( $_GET["page"] == 'google_maps_cp_question') 1012 { 1013 echo("Redirecting to documentation...<script type='text/javascript'>document.location='https://wordpress.org/support/plugin/codepeople-post-map/#new-post';</script>"); 1014 exit; 1015 } 1016 1017 } 1025 if ( ! current_user_can( 'manage_options' ) ){ 1026 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'codepeople-post-map'), 403 ); 1027 } 1018 1028 1019 1029 // Check if post exists and save the configuraton options 1020 if (isset($_POST['cpm_map_noncename']) && wp_verify_nonce($_POST['cpm_map_noncename'],__FILE__)){ 1030 if ( 1031 isset( $_POST['cpm_map_noncename'] ) && 1032 wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cpm_map_noncename'] ) ), __FILE__ ) 1033 ){ 1021 1034 $options = $_POST['cpm_map']; 1022 1035 $options = $this->array_map_recursive('sanitize_text_field', $options); 1036 $options['api_key'] = $this->sanitize_api_key( isset($options['api_key']) ? $options['api_key'] : '' ); 1023 1037 $options['drag_map'] = ( isset( $options[ 'drag_map' ] ) ) ? true : false; 1024 1038 $options['windowhtml'] = $this->get_configuration_option('windowhtml'); … … 1526 1540 1527 1541 $api_key = $this->get_configuration_option( 'api_key' ); 1528 $output .= 'var cpm_api_key = ' . wp_json_encode( (!empty( $api_key )) ? trim($api_key) : '' ) . ";\n";1542 $output .= 'var cpm_api_key = ' . wp_json_encode( (!empty( $api_key )) ? $this->sanitize_api_key( $api_key ) : '' ) . ";\n"; 1529 1543 1530 1544 $output .= "var cpm_global = cpm_global || {};\n"; -
codepeople-post-map/trunk/js/cpm.admin.js
r3259483 r3812534 13 13 typeof cpm_global['api_key'] != 'undefined' && 14 14 cpm_global['api_key'] != '' 15 ) _api_key = 'key='+cpm_global['api_key']+'&'; 15 ) _api_key = 'key='+encodeURIComponent(cpm_global['api_key'])+'&'; 16 17 function cpm_load_maps_api( callback, language ){ 18 var script = document.createElement('script'); 19 var url = (( typeof window.location.protocol != 'undefined' ) ? window.location.protocol : 'http:')+ 20 '//maps.google.com/maps/api/js?loading=async&'+_api_key+'callback='+encodeURIComponent(callback)+ 21 ((language) ? '&language='+encodeURIComponent(language) : '')+'&libraries=marker'; 22 script.type = 'text/javascript'; 23 script.src = url; 24 document.body.appendChild(script); 25 } 16 26 17 27 if(!('gm_authFailure' in window)) … … 122 132 cpm_get_latlng(); 123 133 }else{ 124 $('<script type="text/javascript" src="'+(( typeof window.location.protocol != 'undefined' ) ? window.location.protocol : 'http:' )+'//maps.google.com/maps/api/js?loading=async&'+_api_key+'callback=cpm_get_latlng'+((language) ? '&language='+language: '')+'&libraries=marker"></script>').appendTo('body');134 cpm_load_maps_api('cpm_get_latlng', language); 125 135 } 126 136 }; … … 246 256 else 247 257 { 248 $('<script type="text/javascript" src="'+(( typeof window.location.protocol != 'undefined' ) ? window.location.protocol : 'http:' )+'//maps.google.com/maps/api/js?loading=async&'+_api_key+'callback=cpm_set_map_flag&libraries=marker"></script>').appendTo('body');258 cpm_load_maps_api('cpm_set_map_flag', ''); 249 259 } 250 260 } -
codepeople-post-map/trunk/readme.txt
r3649081 r3812534 5 5 Requires at least: 3.0.5 6 6 Tested up to: 7.1 7 Stable tag: 1.3. 07 Stable tag: 1.3.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 587 587 == Changelog == 588 588 589 = 1.3.1 = 590 591 * Enhanced security in the plugin settings screens with additional authorization checks. Special thanks to AndrewN and the Wordfence team. 592 589 593 = 1.3.0 = 590 594
Note:
See TracChangeset
for help on using the changeset viewer.