CVE-2019-7725
Description
includes/core/is_user.php in NukeViet before 4.3.04 deserializes the untrusted nvloginhash cookie (i.e., the code relies on PHP's serialization format when JSON can be used to eliminate the risk).
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
NukeViet before 4.3.04 deserializes an untrusted cookie (nvloginhash) using PHP's serialization, leading to potential remote code execution via insecure deserialization.
The vulnerability resides in includes/core/is_user.php of NukeViet, a PHP-based CMS. The code deserializes the nvloginhash cookie using PHP's unserialize() function without proper validation, relying on PHP's serialization format when JSON could have been used to eliminate the risk [1]. This allows an attacker to supply a crafted serialized payload within the cookie, which is then deserialized by the server.
Exploitation
An attacker can send a specially crafted nvloginhash cookie containing a malicious serialized PHP object. The deserialization occurs during user authentication checks, potentially before any access controls are enforced [2]. No authentication is required to trigger the deserialization, making it exploitable by any unauthenticated visitor. The vulnerability exists in versions prior to 4.3.04.
Impact
Successful exploitation of PHP insecure deserialization can lead to arbitrary code execution, file manipulation, or other actions depending on the available gadget chains in the application's codebase. The impact is assessed as high, as it can compromise the entire server [1].
Mitigation
The issue was fixed in NukeViet version 4.3.04, released on 2018-10-28 [4]. The fix replaced the insecure deserialization with JSON-based session handling or proper validation, as shown in the commit that removed the vulnerable base64Decode and encodeCookie functions [3]. Users are advised to upgrade to version 4.3.04 or later.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
nukeviet/nukevietPackagist | < 4.3.04 | 4.3.04 |
Affected products
2- NukeViet/NukeVietdescription
Patches
2108aafb03fe1Merge pull request #2743 from hoaquynhtim99/nukeviet4.3
16 files changed · +410 −398
CHANGELOG.txt+235 −223 modified@@ -1,19 +1,31 @@ CHANGE LOG: NUKEVIET CMS http://nukeviet.vn +NUKEVIET 4.3.04 + +- Fix admin can not login +- Add user register callback +- Sitemap: Can split module sitemap +- Remove gregwar/captcha +- Fixed RSS image height +- Fix upload file from ckeditor +- Fix function nv_redirect_location +- Fix upload and auto resize image +- Fix security bug. Thanks hungnguyenmz and Zepto Team + NUKEVIET 4.3.03 - Fix tag contains special characters - Clipboard.js v2.0.1 - gregwar/captcha v1.1.6 -- Module banners: allows to enter links freely -- Module news: fixed bug when attaching file -- Module comment: fix quote comment when post name is empty +- Module banners: allows to enter links freely +- Module news: fixed bug when attaching file +- Module comment: fix quote comment when post name is empty - Fix save file ini - Fix search system logs - Fix check server support rewrite - Turn off error messages when debug mode off -- Module users: Fix update group statistics when delete user, fix user custom field, fix user safe mode +- Module users: Fix update group statistics when delete user, fix user custom field, fix user safe mode NUKEVIET 4.3.02 - Fix save google analytics id @@ -212,11 +224,11 @@ NUKEVIET 4.0.29 Final Releases May 19, 2016 - Fix update, upgrade system and extentions - Fix check update, auto update - Module users: - Add feature for group's leader (creat user, delete user, accept user, delete user, change password), - Update theme redirect login, - Update facebook login - Change rule for view list users - Remove Admin Relogin + Add feature for group's leader (creat user, delete user, accept user, delete user, change password), + Update theme redirect login, + Update facebook login + Change rule for view list users + Remove Admin Relogin - Module extensions: Fix download file - Add more options for module's theme mobile - Support statisics for CocCoc browser @@ -310,8 +322,8 @@ NUKEVIET 4.0.23 (Open beta 9) - Update module Users. - Change Admin-toolbar - Update variables for javascript: - nv_siteroot -> nv_base_siteurl - nv_sitelang -> nv_lang_data + nv_siteroot -> nv_base_siteurl + nv_sitelang -> nv_lang_data - Update Language Français, thank Nguyễn Phú Thành. - Update CKEditor 4.5.3 - Class resquest: Fix block tag @@ -419,133 +431,133 @@ CODE: https://github.com/nukeviet/nukeviet/tree/4.0.13 (88 commits: from commit/ NUKEVIET 4.0.11 (Close beta 11) CODE: https://github.com/nukeviet/nukeviet/tree/4.0.11 (1850 commits: from commit/f73da99 to commit/7143a90) - System - + Use PDO class to replace MySQL class which used in Nukeviet 3 to use many different database. Curently Nukeviet support MySQL, MariaDB, Oracle database - + Nukeviet 4.0 be optimize to save web server resource and running on web server installed PHP 5.3, 5.4, 5.5 - + Fixed setup mutillanguage mode. If the website on single language is turn on eliminating language characters in url. Remove module name in the url. - + Add notification system to admin control panel. - + Rename modules search =>seek, rss =>feeds - - + Add furture module Comment to manage comment in another module. - + Change method cache storeage, each module cache will be store in a folder. Cache be store by domain. - + Support Vietnamese domain name. - + Hosting CDN for javascript, css - + Configue Vietnamese Keyboard (If site installed Vietnamese language. - + Encrypt passwords of FTP account, Account mail SMTP. - + Many values at file /includes/constants.php will be configue in admin control panel. - - + Add IPV6 library to detected coutry by IPV6. - + Fix erro when use flash logo. - + Change the system check for update - + Fixed rewirte on IIS7 with Unicode Permalinks. - + Change method management block, use popup to manage block. - + Add optional feature when website use https protocol - + Add plugin rewirte_absolute to change links into obsolute links. - + Add feature warning by javascript when turning pages editing without save unfinished. - + Additional display warning almost time expried login (automatical timeout). - - + Add configuration check and block computers to if does not agent to don’t have edit code. - + Remove sitemap ping of Yahoo, Ask - + Manage files put into database, support search file. + + Use PDO class to replace MySQL class which used in Nukeviet 3 to use many different database. Curently Nukeviet support MySQL, MariaDB, Oracle database + + Nukeviet 4.0 be optimize to save web server resource and running on web server installed PHP 5.3, 5.4, 5.5 + + Fixed setup mutillanguage mode. If the website on single language is turn on eliminating language characters in url. Remove module name in the url. + + Add notification system to admin control panel. + + Rename modules search =>seek, rss =>feeds + + + Add furture module Comment to manage comment in another module. + + Change method cache storeage, each module cache will be store in a folder. Cache be store by domain. + + Support Vietnamese domain name. + + Hosting CDN for javascript, css + + Configue Vietnamese Keyboard (If site installed Vietnamese language. + + Encrypt passwords of FTP account, Account mail SMTP. + + Many values at file /includes/constants.php will be configue in admin control panel. + + + Add IPV6 library to detected coutry by IPV6. + + Fix erro when use flash logo. + + Change the system check for update + + Fixed rewirte on IIS7 with Unicode Permalinks. + + Change method management block, use popup to manage block. + + Add optional feature when website use https protocol + + Add plugin rewirte_absolute to change links into obsolute links. + + Add feature warning by javascript when turning pages editing without save unfinished. + + Additional display warning almost time expried login (automatical timeout). + + + Add configuration check and block computers to if does not agent to don’t have edit code. + + Remove sitemap ping of Yahoo, Ask + + Manage files put into database, support search file. - Module extensions - + Add module extensions: Manage and install applications from Nukeviet Store. - + Move method installation themes, modules to manage by module module extensions. + + Add module extensions: Manage and install applications from Nukeviet Store. + + Move method installation themes, modules to manage by module module extensions. - Module upload - + Database of module upload is put into site database, support search file. - + Configue thumbnail for each module, size, and quanlity. - + The modules use illustration as module News will creat only one thumb image for each image upload to reduce number of files - + Additional automatical resize image which uploaded to host to the configued size - + Module uploads allows select and work on mutil file, operation with mouse and shortkey common - + Fixed upload image from URL if the link contain blank space. - + Features fill ALT tag for image: After image file uploade completed, the program will ask rename and describe photo to SEO image. + + Database of module upload is put into site database, support search file. + + Configue thumbnail for each module, size, and quanlity. + + The modules use illustration as module News will creat only one thumb image for each image upload to reduce number of files + + Additional automatical resize image which uploaded to host to the configued size + + Module uploads allows select and work on mutil file, operation with mouse and shortkey common + + Fixed upload image from URL if the link contain blank space. + + Features fill ALT tag for image: After image file uploade completed, the program will ask rename and describe photo to SEO image. - The editor - + Use the ckeditor 4.4.7 - + Integrate mathematical formulas - + The feature show a script code in the post, highlight code. + + Use the ckeditor 4.4.7 + + Integrate mathematical formulas + + The feature show a script code in the post, highlight code. - Themes - + Redesign theme of admin control panel base on bootstrap, responsive. - + Use bootstrap framework html, css. Support customizable theme on many devices. - + Additional breadcrumbs in admin control panel theme for the necessary features. - + Add features configue by theme (customizable theme at ACP). - + Remove module name on breakcrumb - + Add two fix blocks on screen to advertising on the sides. + + Redesign theme of admin control panel base on bootstrap, responsive. + + Use bootstrap framework html, css. Support customizable theme on many devices. + + Additional breadcrumbs in admin control panel theme for the necessary features. + + Add features configue by theme (customizable theme at ACP). + + Remove module name on breakcrumb + + Add two fix blocks on screen to advertising on the sides. - Module News - + Decentralization management to each topic. - + Add “New” icon for new articles of the topic. - + Add features enable to moving articles from a categories to another. + + Decentralization management to each topic. + + Add “New” icon for new articles of the topic. + + Add features enable to moving articles from a categories to another. - + Fixed the features of filter by keywords, the keywords in tags instead the keywords from dictionary. - + Additional colors to the article status in admin control panel. Additional the article status: Draft, Deny, re-published (Re-publish the old articles). - + Add the features report the status of articles not published and only be viewed by admin outside (To avoid link of those article send by admin are unavailable with others). + + Fixed the features of filter by keywords, the keywords in tags instead the keywords from dictionary. + + Additional colors to the article status in admin control panel. Additional the article status: Draft, Deny, re-published (Re-publish the old articles). + + Add the features report the status of articles not published and only be viewed by admin outside (To avoid link of those article send by admin are unavailable with others). - + Add the feature show illustrate image of categorise. - + Allows linebreak in short introduction - + Add default configuration show illustrate image in detail page. + + Add the feature show illustrate image of categorise. + + Allows linebreak in short introduction + + Add default configuration show illustrate image in detail page. - + Additional show tooltip in list articles, blocks. - + Show numbers article view in admin control panel. + + Additional show tooltip in list articles, blocks. + + Show numbers article view in admin control panel. - Integrate the feature ping article. - + Optimize html tags for SEO. - + Add feature Tags for the article: Confige site name – keywords - description for each Tag as groups management. - + Add social network tools: Like facebook, G + , twitter button, comment of facebook (Block in module comment). + + Optimize html tags for SEO. + + Add feature Tags for the article: Confige site name – keywords - description for each Tag as groups management. + + Add social network tools: Like facebook, G + , twitter button, comment of facebook (Block in module comment). - Replace module about by module page - + Have illustrate image, note, description (support for SEO). - + Config show tools of Like facebook, G + , Twitter - + Config comment facebook feature in use. - + Config Google + authentication (Copyright, similar module news) - + Config each article use a layout, it mean each article has one theme. - + Add RSS for module page. - + Configuration alternatives shown the article in the main page. - + Add list article block. + + Have illustrate image, note, description (support for SEO). + + Config show tools of Like facebook, G + , Twitter + + Config comment facebook feature in use. + + Config Google + authentication (Copyright, similar module news) + + Config each article use a layout, it mean each article has one theme. + + Add RSS for module page. + + Configuration alternatives shown the article in the main page. + + Add list article block. - Module user - + Replace OpenID by OAuth 1.x and Oauth 2.0 to login via google, facebook. - + Add phpCAS library to login SSO via CAS server, and get information via LDAP. - + Add feature customizable user fields data. - + Add feature config decentralization use module Users. - + Add configuration to allows control username character when registering. - + Add configuration to allows control passwords complexity. - + Fixed passwords recovery mechanism - + Add feature forbiden use simply passwords. - + Add feature lock account, delete account when delete website admin account. - + Add feature creat random passwords for admin. - + Use username or e-mail to log in. - + Change decentralization of features according to user groups. - + Add feature allows account under admin in the administrator log in and add configuration of it. - + Split field full_name to first_name and last_name, configure display names (full name – surename). + + Replace OpenID by OAuth 1.x and Oauth 2.0 to login via google, facebook. + + Add phpCAS library to login SSO via CAS server, and get information via LDAP. + + Add feature customizable user fields data. + + Add feature config decentralization use module Users. + + Add configuration to allows control username character when registering. + + Add configuration to allows control passwords complexity. + + Fixed passwords recovery mechanism + + Add feature forbiden use simply passwords. + + Add feature lock account, delete account when delete website admin account. + + Add feature creat random passwords for admin. + + Use username or e-mail to log in. + + Change decentralization of features according to user groups. + + Add feature allows account under admin in the administrator log in and add configuration of it. + + Split field full_name to first_name and last_name, configure display names (full name – surename). - Module download - + Fixed the navigation of links - + Fixed description when show detail. + + Fixed the navigation of links + + Fixed description when show detail. - Add module SEO tool. - + Gather configurations and web SEO tool to this moudle. - + Add feature remove module name in url when disable mutillanguage mode. - + Add feature change the path of the module for easy SEO url. - + Add feature authentication Google + (copyright). - + Add feature Ping to search engine. - + Support Meta OG of facebook. Add new meta ogp, add data for $meta_property array. - + Support insert Meta GEO via Meta- Tags configuration. + + Gather configurations and web SEO tool to this moudle. + + Add feature remove module name in url when disable mutillanguage mode. + + Add feature change the path of the module for easy SEO url. + + Add feature authentication Google + (copyright). + + Add feature Ping to search engine. + + Support Meta OG of facebook. Add new meta ogp, add data for $meta_property array. + + Support insert Meta GEO via Meta- Tags configuration. - Module staticts - + Change the mechanism calculating the number of hits the site. Recount after visitor don’t active in 30 minutes. - + Only admin can see default configure. + + Change the mechanism calculating the number of hits the site. Recount after visitor don’t active in 30 minutes. + + Only admin can see default configure. - Module banner - + Add feature of display banner: banner flash is replacing by photo on mobile browsers (Because adobe flash don’t run on some browsers). - + Add feature for ad: when click ad, choose open: In new windows, in current windows… - + Add global.department.php block (display department contact information). - + Admin can answer customer more times, the system log all the replies. + + Add feature of display banner: banner flash is replacing by photo on mobile browsers (Because adobe flash don’t run on some browsers). + + Add feature for ad: when click ad, choose open: In new windows, in current windows… + + Add global.department.php block (display department contact information). + + Admin can answer customer more times, the system log all the replies. - Module menu - + Change menu management more visually. - + Split menu types into block menu distinct. + + Change menu management more visually. + + Split menu types into block menu distinct. NUKEVIET 3.4.02 (3.4.02.r1929) Releases Jan 9, 2014 CODE: http://code.google.com/p/nuke-viet/source/list (r1759 to r1929) @@ -657,119 +669,119 @@ Remove features: NUKEVIET 3.2 Official (3.2.00.r1203) CODE: http://code.google.com/p/nuke-viet/source/list (r931 to r1203) - SYSTEM - + Fix Duplicate title tags and meta descriptions. - + Fix update by revision feature - + Config domain allows use localhost - + Config method update language pack by revision. - + Fixed 404 erro when url contain special character. - + Update editor, fixed quick upload in the editor. - + Update JW Player 5.5. Add feature select image illustration for plugin JW Player of the editor. - + Check server status, if CPU use >80 % will report “Server too busy. Please try again later”. - + Edit to customizable tool bar of admin control panel. - + Redefine theme is using at time configure. - + Fix not detected theme when install new module. - + Fix module rss, and modules relation with module rss. - + Delete caches of modules when changing configuration block. - + Fixed erro at file image.class.php. - + Fixed chmod in used FTP. - + Fixed install module: Allows modules don’t have outside function. - + Fixed system for functions outside of module is not obligatory. - + Fixed block menu when theme by module. - + Update jQuery and plugins: jQuery v1.5.2, jQuery UI. - + Use class phpsvnclient: In case commit file use Replace. - + Upgrade openid.class.php - + Fixed function check mimetype when upload file. - + Add feature delete module has not used (Delete files of the modules). - + Rewrite for servers which are not supported. - + Fixed XML Sitemap index on hosting which not support full rewrite. - + Fixed file Sitemap.xml to Google Webmaster Tools detect easier. - + Fixed erro misindentified module while enable rewrite feature. - + Improve to can rewrite single url. - + Rewrite links while sending mail. - + Add rewriteBase into file .htaccess - + Fixed rewrite in case the hosting does not support zlib lead to not loaded css, js. - + Fixed rewrite on IIS7 to not lose configuration at file web.config. Fixed check rewrite on IIS7. + + Fix Duplicate title tags and meta descriptions. + + Fix update by revision feature + + Config domain allows use localhost + + Config method update language pack by revision. + + Fixed 404 erro when url contain special character. + + Update editor, fixed quick upload in the editor. + + Update JW Player 5.5. Add feature select image illustration for plugin JW Player of the editor. + + Check server status, if CPU use >80 % will report “Server too busy. Please try again later”. + + Edit to customizable tool bar of admin control panel. + + Redefine theme is using at time configure. + + Fix not detected theme when install new module. + + Fix module rss, and modules relation with module rss. + + Delete caches of modules when changing configuration block. + + Fixed erro at file image.class.php. + + Fixed chmod in used FTP. + + Fixed install module: Allows modules don’t have outside function. + + Fixed system for functions outside of module is not obligatory. + + Fixed block menu when theme by module. + + Update jQuery and plugins: jQuery v1.5.2, jQuery UI. + + Use class phpsvnclient: In case commit file use Replace. + + Upgrade openid.class.php + + Fixed function check mimetype when upload file. + + Add feature delete module has not used (Delete files of the modules). + + Rewrite for servers which are not supported. + + Fixed XML Sitemap index on hosting which not support full rewrite. + + Fixed file Sitemap.xml to Google Webmaster Tools detect easier. + + Fixed erro misindentified module while enable rewrite feature. + + Improve to can rewrite single url. + + Rewrite links while sending mail. + + Add rewriteBase into file .htaccess + + Fixed rewrite in case the hosting does not support zlib lead to not loaded css, js. + + Fixed rewrite on IIS7 to not lose configuration at file web.config. Fixed check rewrite on IIS7. - Theme - + Devide language of block to single file. - + Theme default: fixed erro not rewrite link of statisticts. - + Fixed erro undisplay content of block html which contain special character. - + Fixed theme management: Delete block when delete theme. + + Devide language of block to single file. + + Theme default: fixed erro not rewrite link of statisticts. + + Fixed erro undisplay content of block html which contain special character. + + Fixed theme management: Delete block when delete theme. - Web tools - + Add feature delete IP logs - + Add select all works in cleanup system. - + Config check Nukeviet version feature. - + Update upgrade function via Revision. Only get the updates in the directory /trunk/nukeviet 3.2 - + Fixed Revision update function in system folder is renamed. - + Update by Revision. On the hostings need FTP to creat folder and move file. + + Add feature delete IP logs + + Add select all works in cleanup system. + + Config check Nukeviet version feature. + + Update upgrade function via Revision. Only get the updates in the directory /trunk/nukeviet 3.2 + + Fixed Revision update function in system folder is renamed. + + Update by Revision. On the hostings need FTP to creat folder and move file. - System log - + Record system log in these important events. - + Add tool filter system log, change type of arrangement system log default. - + Update module users - + Allows user register in public group. - + Add configuration for users retrieve passwords without be ask secret questions. - + Fixed error not add, edit users when mechanism forum. - + Fixed error GodAdmin unable to delete admin. - + Fixed error active user account. - + Disable autocomplete function at edit user accounts. - + Fixed error can not change e-mail while loging in. - + Remove dots befor @ character while check valid of e-mail (uname@gmail.com =u.name@gmail.com) - + Block login: Fixed path of avata, OpenID image. + + Record system log in these important events. + + Add tool filter system log, change type of arrangement system log default. + + Update module users + + Allows user register in public group. + + Add configuration for users retrieve passwords without be ask secret questions. + + Fixed error not add, edit users when mechanism forum. + + Fixed error GodAdmin unable to delete admin. + + Fixed error active user account. + + Disable autocomplete function at edit user accounts. + + Fixed error can not change e-mail while loging in. + + Remove dots befor @ character while check valid of e-mail (uname@gmail.com =u.name@gmail.com) + + Block login: Fixed path of avata, OpenID image. - Module News - + Fixed time post article. Time post article must after time creat article. - + Delete cache of module when users delete article. - + Fixed incorrect image display of the article in block headline. - + Fixed error show titles of articles that have not posted in sitemap. - + Fixed page breaking error while config module “By title, the new up”. - + Fixed rss links of News vitualization module at theme modern. - + Fixed error can not edit information resource. - + Fixed delete thumb when delete article. - + Fixed form comment for theme modern. - + Fixed show comment, fixed page breaking at comment management. - + Devide HTML and PHP + + Fixed time post article. Time post article must after time creat article. + + Delete cache of module when users delete article. + + Fixed incorrect image display of the article in block headline. + + Fixed error show titles of articles that have not posted in sitemap. + + Fixed page breaking error while config module “By title, the new up”. + + Fixed rss links of News vitualization module at theme modern. + + Fixed error can not edit information resource. + + Fixed delete thumb when delete article. + + Fixed form comment for theme modern. + + Fixed show comment, fixed page breaking at comment management. + + Devide HTML and PHP - Module menu - + Add feature management menus. - + Fixed error functions be shown in menu of module User (customizable via login status). - + Fixed function name of menus to use many type menu at the same time. - + Block menu smooth_navigational don’t show sub menu of module weblinks. - + Module Language - + Manage block language + + Add feature management menus. + + Fixed error functions be shown in menu of module User (customizable via login status). + + Fixed function name of menus to use many type menu at the same time. + + Block menu smooth_navigational don’t show sub menu of module weblinks. + + Module Language + + Manage block language - Module FAQ: - + Fixed module to not obligatory enter question to topic and add presentation. - + Module download: Fixed path avata of user. + + Fixed module to not obligatory enter question to topic and add presentation. + + Module download: Fixed path avata of user. - Module about: - + Fixed error show inactive article. + + Fixed error show inactive article. - Merge Module Shop project to Nukeviet 3.2 - CODE: http://code.google.com/p/nuke-viet/source/list (r2) - + Organize shop presentation by criteria: Product type, product group, new update product… - + The feature to see and select product: Categorise product type, the same product, sample product, product most viewed.. - + Shop cart: Add allows order product to shop cart. - + Pay online by ATM card throught payment system of Nganluong.vn - + Send order: Member website submit order. - + Deal history: Show deal historys of members. - + The system administrator functions include: - + Currency management: Allows add, edit, delete currency. - + Manage payment gateways mecharnismed: Config payment gateways if use 1 or more onlien payment gateways. - + Configuration: Set parameters for the sales system. - + Management product units: Add, edit, delete product unit. - + Manage product categorise: Add, edit, delete - + Managet product group (by criteria): add, edit, delete. - + Manage blocks (product group). - + Manage list of manufacturers. - + Manage list products: add, edit, delete, search.. - + Manage of orders and print invoices. - + Fixed Module shop error - + Fixed error paging - + Auto cut introduction shorter when it shown. - + Trim introduction shorter if too length be allows to avoid undefined error. - + Fixed comment product error. + CODE: http://code.google.com/p/nuke-viet/source/list (r2) + + Organize shop presentation by criteria: Product type, product group, new update product… + + The feature to see and select product: Categorise product type, the same product, sample product, product most viewed.. + + Shop cart: Add allows order product to shop cart. + + Pay online by ATM card throught payment system of Nganluong.vn + + Send order: Member website submit order. + + Deal history: Show deal historys of members. + + The system administrator functions include: + + Currency management: Allows add, edit, delete currency. + + Manage payment gateways mecharnismed: Config payment gateways if use 1 or more onlien payment gateways. + + Configuration: Set parameters for the sales system. + + Management product units: Add, edit, delete product unit. + + Manage product categorise: Add, edit, delete + + Managet product group (by criteria): add, edit, delete. + + Manage blocks (product group). + + Manage list of manufacturers. + + Manage list products: add, edit, delete, search.. + + Manage of orders and print invoices. + + Fixed Module shop error + + Fixed error paging + + Auto cut introduction shorter when it shown. + + Trim introduction shorter if too length be allows to avoid undefined error. + + Fixed comment product error. NUKEVIET 3.1 Official version (3.1.03.r930) CODE: http://code.google.com/p/nuke-viet/source/list (r784 to r930) @@ -782,27 +794,27 @@ CODE: http://code.google.com/p/nuke-viet/source/list (r469 to r783) - Fixed bugs and optimize old features - Module News: - + Allows display illustration outside of the site. - + Add feature post/edit/delete article for members. - + Additional configure represented as a grid, by list article. - + Increase system cache, compress CSS, JavaScript.. to speed up loading page. - + Add feature “Delete all temp file” for God Admin. - + Add Google Analytics tracking code at http://code.google.com/p/nuke-viet/source/detail?r=556 + + Allows display illustration outside of the site. + + Add feature post/edit/delete article for members. + + Additional configure represented as a grid, by list article. + + Increase system cache, compress CSS, JavaScript.. to speed up loading page. + + Add feature “Delete all temp file” for God Admin. + + Add Google Analytics tracking code at http://code.google.com/p/nuke-viet/source/detail?r=556 - Add feature for SEO - + Add feature meta-tags management. - + Auto creat sitemap file for search engine. - + Add sitemap Ping Services (Send sitemap files to search engine by PING). - + Rating according to the index site. - + Check SEO by keywords. + + Add feature meta-tags management. + + Auto creat sitemap file for search engine. + + Add sitemap Ping Services (Send sitemap files to search engine by PING). + + Rating according to the index site. + + Check SEO by keywords. - The feature of upgrade, check version. - + Add upgrade information from Nukeviet project. - + Auto report new version in Admin control panel. - + Add feature check module version - + Add feature system upgrade by upgrade package. - + Add feature upgrade via revision. - + Increase ability auto install for block, module even when be overwriting or non-standard. + + Add upgrade information from Nukeviet project. + + Auto report new version in Admin control panel. + + Add feature check module version + + Add feature system upgrade by upgrade package. + + Add feature upgrade via revision. + + Increase ability auto install for block, module even when be overwriting or non-standard. - Restructuring block, allows global block located block of module, allows add more parameters for the block. - Add Admin full theme and use this theme for admin control panel. - Fixed upload feature, add the feature allows each admin upload to each folder of module news.
includes/action_mysql.php+130 −130 modified@@ -47,158 +47,158 @@ function nv_create_table_sys($lang) $sql_create_table = array(); $sql_create_table[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_modules ( - title varchar(50) NOT NULL, - module_file varchar(50) NOT NULL DEFAULT '', - module_data varchar(50) NOT NULL DEFAULT '', - module_upload varchar(50) NOT NULL DEFAULT '', - module_theme varchar(50) NOT NULL DEFAULT '', + title varchar(50) NOT NULL, + module_file varchar(50) NOT NULL DEFAULT '', + module_data varchar(50) NOT NULL DEFAULT '', + module_upload varchar(50) NOT NULL DEFAULT '', + module_theme varchar(50) NOT NULL DEFAULT '', custom_title varchar(255) NOT NULL, site_title varchar(255) NOT NULL DEFAULT '', - admin_title varchar(255) NOT NULL DEFAULT '', - set_time int(11) unsigned NOT NULL DEFAULT '0', - main_file tinyint(1) unsigned NOT NULL DEFAULT '0', - admin_file tinyint(1) unsigned NOT NULL DEFAULT '0', - theme varchar(100) DEFAULT '', - mobile varchar(100) DEFAULT '', - description varchar(255) DEFAULT '', - keywords text, - groups_view varchar(255) NOT NULL, - weight tinyint(3) unsigned NOT NULL DEFAULT '1', - act tinyint(1) unsigned NOT NULL DEFAULT '0', - admins varchar(255) DEFAULT '', - rss tinyint(4) NOT NULL DEFAULT '1', - sitemap tinyint(4) NOT NULL DEFAULT '1', - gid smallint(5) NOT NULL DEFAULT '0', - PRIMARY KEY (title) - ) ENGINE=MyISAM"; + admin_title varchar(255) NOT NULL DEFAULT '', + set_time int(11) unsigned NOT NULL DEFAULT '0', + main_file tinyint(1) unsigned NOT NULL DEFAULT '0', + admin_file tinyint(1) unsigned NOT NULL DEFAULT '0', + theme varchar(100) DEFAULT '', + mobile varchar(100) DEFAULT '', + description varchar(255) DEFAULT '', + keywords text, + groups_view varchar(255) NOT NULL, + weight tinyint(3) unsigned NOT NULL DEFAULT '1', + act tinyint(1) unsigned NOT NULL DEFAULT '0', + admins varchar(255) DEFAULT '', + rss tinyint(4) NOT NULL DEFAULT '1', + sitemap tinyint(4) NOT NULL DEFAULT '1', + gid smallint(5) NOT NULL DEFAULT '0', + PRIMARY KEY (title) + ) ENGINE=MyISAM"; $sql_create_table[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_blocks_groups ( - bid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - theme varchar(55) NOT NULL, - module varchar(55) NOT NULL, - file_name varchar(55) DEFAULT NULL, - title varchar(255) DEFAULT NULL, - link varchar(255) DEFAULT NULL, - template varchar(55) DEFAULT NULL, - position varchar(55) DEFAULT NULL, - exp_time int(11) DEFAULT '0', - active varchar(10) DEFAULT '1', + bid mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + theme varchar(55) NOT NULL, + module varchar(55) NOT NULL, + file_name varchar(55) DEFAULT NULL, + title varchar(255) DEFAULT NULL, + link varchar(255) DEFAULT NULL, + template varchar(55) DEFAULT NULL, + position varchar(55) DEFAULT NULL, + exp_time int(11) DEFAULT '0', + active varchar(10) DEFAULT '1', act tinyint(1) unsigned NOT NULL DEFAULT '1', - groups_view varchar(255) DEFAULT '', - all_func tinyint(4) NOT NULL DEFAULT '0', - weight int(11) NOT NULL DEFAULT '0', - config text, - PRIMARY KEY (bid), - KEY theme (theme), - KEY module (module), - KEY position (position), - KEY exp_time (exp_time) - ) ENGINE=MyISAM"; + groups_view varchar(255) DEFAULT '', + all_func tinyint(4) NOT NULL DEFAULT '0', + weight int(11) NOT NULL DEFAULT '0', + config text, + PRIMARY KEY (bid), + KEY theme (theme), + KEY module (module), + KEY position (position), + KEY exp_time (exp_time) + ) ENGINE=MyISAM"; $sql_create_table[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_blocks_weight ( - bid mediumint(8) NOT NULL DEFAULT '0', - func_id mediumint(8) NOT NULL DEFAULT '0', - weight mediumint(8) NOT NULL DEFAULT '0', - UNIQUE KEY bid (bid,func_id) - ) ENGINE=MyISAM"; + bid mediumint(8) NOT NULL DEFAULT '0', + func_id mediumint(8) NOT NULL DEFAULT '0', + weight mediumint(8) NOT NULL DEFAULT '0', + UNIQUE KEY bid (bid,func_id) + ) ENGINE=MyISAM"; $sql_create_table[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_modfuncs ( - func_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - func_name varchar(55) NOT NULL, - alias varchar(55) NOT NULL DEFAULT '', - func_custom_name varchar(255) NOT NULL, - func_site_title varchar(255) NOT NULL DEFAULT '', - in_module varchar(50) NOT NULL, - show_func tinyint(4) NOT NULL DEFAULT '0', - in_submenu tinyint(1) unsigned NOT NULL DEFAULT '0', - subweight smallint(2) unsigned NOT NULL DEFAULT '1', - setting varchar(255) NOT NULL DEFAULT '', - PRIMARY KEY (func_id), - UNIQUE KEY func_name (func_name,in_module), - UNIQUE KEY alias (alias,in_module) - ) ENGINE=MyISAM"; + func_id mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + func_name varchar(55) NOT NULL, + alias varchar(55) NOT NULL DEFAULT '', + func_custom_name varchar(255) NOT NULL, + func_site_title varchar(255) NOT NULL DEFAULT '', + in_module varchar(50) NOT NULL, + show_func tinyint(4) NOT NULL DEFAULT '0', + in_submenu tinyint(1) unsigned NOT NULL DEFAULT '0', + subweight smallint(2) unsigned NOT NULL DEFAULT '1', + setting varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (func_id), + UNIQUE KEY func_name (func_name,in_module), + UNIQUE KEY alias (alias,in_module) + ) ENGINE=MyISAM"; $sql_create_table[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_searchkeys ( - id varchar(32) NOT NULL DEFAULT '', - skey varchar(250) NOT NULL, - total int(11) NOT NULL DEFAULT '0', - search_engine varchar(50) NOT NULL, - KEY (id), - KEY skey (skey), - KEY search_engine (search_engine) - ) ENGINE=MyISAM"; + id varchar(32) NOT NULL DEFAULT '', + skey varchar(250) NOT NULL, + total int(11) NOT NULL DEFAULT '0', + search_engine varchar(50) NOT NULL, + KEY (id), + KEY skey (skey), + KEY search_engine (search_engine) + ) ENGINE=MyISAM"; $sql_create_table[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_referer_stats ( - host varchar(250) NOT NULL, - total int(11) NOT NULL DEFAULT '0', - month01 int(11) NOT NULL DEFAULT '0', - month02 int(11) NOT NULL DEFAULT '0', - month03 int(11) NOT NULL DEFAULT '0', - month04 int(11) NOT NULL DEFAULT '0', - month05 int(11) NOT NULL DEFAULT '0', - month06 int(11) NOT NULL DEFAULT '0', - month07 int(11) NOT NULL DEFAULT '0', - month08 int(11) NOT NULL DEFAULT '0', - month09 int(11) NOT NULL DEFAULT '0', - month10 int(11) NOT NULL DEFAULT '0', - month11 int(11) NOT NULL DEFAULT '0', - month12 int(11) NOT NULL DEFAULT '0', - last_update int(11) NOT NULL DEFAULT '0', - UNIQUE KEY host (host), - KEY total (total) - ) ENGINE=MyISAM"; + host varchar(250) NOT NULL, + total int(11) NOT NULL DEFAULT '0', + month01 int(11) NOT NULL DEFAULT '0', + month02 int(11) NOT NULL DEFAULT '0', + month03 int(11) NOT NULL DEFAULT '0', + month04 int(11) NOT NULL DEFAULT '0', + month05 int(11) NOT NULL DEFAULT '0', + month06 int(11) NOT NULL DEFAULT '0', + month07 int(11) NOT NULL DEFAULT '0', + month08 int(11) NOT NULL DEFAULT '0', + month09 int(11) NOT NULL DEFAULT '0', + month10 int(11) NOT NULL DEFAULT '0', + month11 int(11) NOT NULL DEFAULT '0', + month12 int(11) NOT NULL DEFAULT '0', + last_update int(11) NOT NULL DEFAULT '0', + UNIQUE KEY host (host), + KEY total (total) + ) ENGINE=MyISAM"; $sql_create_table[] = "CREATE TABLE " . $db_config['prefix'] . "_" . $lang . "_modthemes ( - func_id mediumint(8) DEFAULT NULL, - layout varchar(100) DEFAULT NULL, - theme varchar(100) DEFAULT NULL, - UNIQUE KEY func_id (func_id,layout,theme) - ) ENGINE=MyISAM"; + func_id mediumint(8) DEFAULT NULL, + layout varchar(100) DEFAULT NULL, + theme varchar(100) DEFAULT NULL, + UNIQUE KEY func_id (func_id,layout,theme) + ) ENGINE=MyISAM"; $sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_" . $lang . "_modules ( title, module_file, module_data, module_upload, module_theme, custom_title, admin_title, set_time, main_file, admin_file, theme, mobile, description, keywords, groups_view, weight, act, admins, rss, gid ) VALUES - ('about', 'page', 'about', 'about', 'page', 'About', '', 1533549600, 1, 1, '', '', '', '', '0', 1, 1, '', 1, 0), - ('news', 'news', 'news', 'news', 'news', 'News', '', 1533549600, 1, 1, '', '', '', '', '0', 2, 1, '', 1, 0), - ('users', 'users', 'users', 'users', 'users', 'Users', 'Users', 1533549600, 1, 1, '', '', '', '', '0', 3, 1, '', 0, 0), - ('contact', 'contact', 'contact', 'contact', 'contact', 'Contact', '', 1533549600, 1, 1, '', '', '', '', '0', 4, 1, '', 0, 0), - ('statistics', 'statistics', 'statistics', 'statistics', 'statistics', 'Statistics', '', 1533549600, 1, 0, '', '', '', '', '0', 5, 1, '', 0, 0), - ('voting', 'voting', 'voting', 'voting', 'voting', 'Voting', '', 1533549600, 1, 1, '', '', '', '', '0', 6, 1, '', 1, 0), - ('banners', 'banners', 'banners', 'banners', 'banners', 'Banners', '', 1533549600, 1, 1, '', '', '', '', '0', 7, 1, '', 0, 0), - ('seek', 'seek', 'seek', 'seek', 'seek', 'Search', '', 1533549600, 1, 0, '', '', '', '', '0', 8, 1, '', 0, 0), - ('menu', 'menu', 'menu', 'menu', 'menu', 'Menu Site', '', 1533549600, 0, 1, '', '', '', '', '0', 9, 1, '', 0, 0), - ('feeds', 'feeds', 'feeds', 'feeds', 'feeds', 'Rss Feeds', '', 1533549600, 1, 1, '', '', '', '', '0', 10, 1, '', 0, 0), - ('page', 'page', 'page', 'page', 'page', 'Page', '', 1533549600, 1, 1, '', '', '', '', '0', 11, 1, '', 1, 0), - ('comment', 'comment', 'comment', 'comment', 'comment', 'Comment', '', 1533549600, 1, 1, '', '', '', '', '0', 12, 1, '', 0, 0), - ('siteterms', 'page', 'siteterms', 'siteterms', 'page', 'Siteterms', '', 1533549600, 1, 1, '', '', '', '', '0', 13, 1, '', 1, 0), - ('freecontent', 'freecontent', 'freecontent', 'freecontent', 'freecontent', 'Free Content', '', 1533549600, 0, 1, '', '', '', '', '0', 14, 1, '', 0, 0), - ('two-step-verification', 'two-step-verification', 'two_step_verification', 'two-step-verification', 'two_step_verification', 'Two-Step Verification', '', 1533549600, 1, 0, '', '', '', '', '0', 15, 1, '', 0, 0)"; + ('about', 'page', 'about', 'about', 'page', 'About', '', 1542337256, 1, 1, '', '', '', '', '0', 1, 1, '', 1, 0), + ('news', 'news', 'news', 'news', 'news', 'News', '', 1542337256, 1, 1, '', '', '', '', '0', 2, 1, '', 1, 0), + ('users', 'users', 'users', 'users', 'users', 'Users', 'Users', 1542337256, 1, 1, '', '', '', '', '0', 3, 1, '', 0, 0), + ('contact', 'contact', 'contact', 'contact', 'contact', 'Contact', '', 1542337256, 1, 1, '', '', '', '', '0', 4, 1, '', 0, 0), + ('statistics', 'statistics', 'statistics', 'statistics', 'statistics', 'Statistics', '', 1542337256, 1, 0, '', '', '', '', '0', 5, 1, '', 0, 0), + ('voting', 'voting', 'voting', 'voting', 'voting', 'Voting', '', 1542337256, 1, 1, '', '', '', '', '0', 6, 1, '', 1, 0), + ('banners', 'banners', 'banners', 'banners', 'banners', 'Banners', '', 1542337256, 1, 1, '', '', '', '', '0', 7, 1, '', 0, 0), + ('seek', 'seek', 'seek', 'seek', 'seek', 'Search', '', 1542337256, 1, 0, '', '', '', '', '0', 8, 1, '', 0, 0), + ('menu', 'menu', 'menu', 'menu', 'menu', 'Menu Site', '', 1542337256, 0, 1, '', '', '', '', '0', 9, 1, '', 0, 0), + ('feeds', 'feeds', 'feeds', 'feeds', 'feeds', 'Rss Feeds', '', 1542337256, 1, 1, '', '', '', '', '0', 10, 1, '', 0, 0), + ('page', 'page', 'page', 'page', 'page', 'Page', '', 1542337256, 1, 1, '', '', '', '', '0', 11, 1, '', 1, 0), + ('comment', 'comment', 'comment', 'comment', 'comment', 'Comment', '', 1542337256, 1, 1, '', '', '', '', '0', 12, 1, '', 0, 0), + ('siteterms', 'page', 'siteterms', 'siteterms', 'page', 'Siteterms', '', 1542337256, 1, 1, '', '', '', '', '0', 13, 1, '', 1, 0), + ('freecontent', 'freecontent', 'freecontent', 'freecontent', 'freecontent', 'Free Content', '', 1542337256, 0, 1, '', '', '', '', '0', 14, 1, '', 0, 0), + ('two-step-verification', 'two-step-verification', 'two_step_verification', 'two-step-verification', 'two_step_verification', 'Two-Step Verification', '', 1542337256, 1, 0, '', '', '', '', '0', 15, 1, '', 0, 0)"; $sql_create_table[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES - ('" . $lang . "', 'global', 'site_domain', ''), - ('" . $lang . "', 'global', 'site_name', 'NukeViet CMS 4.x'), - ('" . $lang . "', 'global', 'site_logo', ''), - ('" . $lang . "', 'global', 'site_banner', ''), - ('" . $lang . "', 'global', 'site_favicon', ''), - ('" . $lang . "', 'global', 'site_description', 'Sharing success, connect passions'), - ('" . $lang . "', 'global', 'site_keywords', ''), - ('" . $lang . "', 'global', 'theme_type', 'r,d,m'), - ('" . $lang . "', 'global', 'site_theme', '" . $global_config['site_theme'] . "'), - ('" . $lang . "', 'global', 'preview_theme', ''), - ('" . $lang . "', 'global', 'mobile_theme', 'mobile_default'), - ('" . $lang . "', 'global', 'site_home_module', 'users'), - ('" . $lang . "', 'global', 'switch_mobi_des', '1'), - ('" . $lang . "', 'global', 'upload_logo', ''), - ('" . $lang . "', 'global', 'upload_logo_pos', 'bottomRight'), - ('" . $lang . "', 'global', 'autologosize1', '50'), - ('" . $lang . "', 'global', 'autologosize2', '40'), - ('" . $lang . "', 'global', 'autologosize3', '30'), - ('" . $lang . "', 'global', 'autologomod', ''), - ('" . $lang . "', 'global', 'name_show', '" . ($lang!='vi' ? 1 : 0) . "'), - ('" . $lang . "', 'global', 'cronjobs_next_time', '" . NV_CURRENTTIME . "'), - ('" . $lang . "', 'global', 'disable_site_content', 'For technical reasons Web site temporary not available. we are very sorry for any inconvenience!'), - ('" . $lang . "', 'seotools', 'prcservice', '')"; + ('" . $lang . "', 'global', 'site_domain', ''), + ('" . $lang . "', 'global', 'site_name', 'NukeViet CMS 4.x'), + ('" . $lang . "', 'global', 'site_logo', ''), + ('" . $lang . "', 'global', 'site_banner', ''), + ('" . $lang . "', 'global', 'site_favicon', ''), + ('" . $lang . "', 'global', 'site_description', 'Sharing success, connect passions'), + ('" . $lang . "', 'global', 'site_keywords', ''), + ('" . $lang . "', 'global', 'theme_type', 'r,d,m'), + ('" . $lang . "', 'global', 'site_theme', '" . $global_config['site_theme'] . "'), + ('" . $lang . "', 'global', 'preview_theme', ''), + ('" . $lang . "', 'global', 'mobile_theme', 'mobile_default'), + ('" . $lang . "', 'global', 'site_home_module', 'users'), + ('" . $lang . "', 'global', 'switch_mobi_des', '1'), + ('" . $lang . "', 'global', 'upload_logo', ''), + ('" . $lang . "', 'global', 'upload_logo_pos', 'bottomRight'), + ('" . $lang . "', 'global', 'autologosize1', '50'), + ('" . $lang . "', 'global', 'autologosize2', '40'), + ('" . $lang . "', 'global', 'autologosize3', '30'), + ('" . $lang . "', 'global', 'autologomod', ''), + ('" . $lang . "', 'global', 'name_show', '" . ($lang!='vi' ? 1 : 0) . "'), + ('" . $lang . "', 'global', 'cronjobs_next_time', '" . NV_CURRENTTIME . "'), + ('" . $lang . "', 'global', 'disable_site_content', 'For technical reasons Web site temporary not available. we are very sorry for any inconvenience!'), + ('" . $lang . "', 'seotools', 'prcservice', '')"; $lang_weight = $db->query('SELECT MAX(weight) FROM ' . $db_config['prefix'] . '_setup_language')->fetchColumn() + 1;
install/data.php+19 −19 modified@@ -150,24 +150,24 @@ $sql_create_table[] = "INSERT INTO " . NV_CRONJOBS_GLOBALTABLE . " (start_time, inter_val, run_file, run_func, params, del, is_sys, act, last_time, last_result) VALUES (" . NV_CURRENTTIME . ", 60, 'check_version.php', 'cron_auto_check_version', '', 0, 1, 1, 0, 0)"; $sql_create_table[] = "INSERT INTO " . NV_CRONJOBS_GLOBALTABLE . " (start_time, inter_val, run_file, run_func, params, del, is_sys, act, last_time, last_result) VALUES (" . NV_CURRENTTIME . ", 1440, 'notification_autodel.php', 'cron_notification_autodel', '', 0, 1, 1, 0, 0)"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (0, 'module', 'about', 0, 0, 'page', 'about', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (0, 'module', 'siteterms', 0, 0, 'page', 'siteterms', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (19, 'module', 'banners', 1, 0, 'banners', 'banners', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (20, 'module', 'contact', 0, 1, 'contact', 'contact', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (1, 'module', 'news', 0, 1, 'news', 'news', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (21, 'module', 'voting', 0, 0, 'voting', 'voting', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (22, 'module', 'forum', 0, 0, 'forum', 'forum', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (284, 'module', 'seek', 1, 0, 'seek', 'seek', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (24, 'module', 'users', 1, 1, 'users', 'users', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (27, 'module', 'statistics', 0, 0, 'statistics', 'statistics', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (29, 'module', 'menu', 0, 0, 'menu', 'menu', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (283, 'module', 'feeds', 1, 0, 'feeds', 'feeds', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (282, 'module', 'page', 1, 1, 'page', 'page', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (281, 'module', 'comment', 1, 0, 'comment', 'comment', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (312, 'module', 'freecontent', 0, 1, 'freecontent', 'freecontent', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (327, 'module', 'two-step-verification', 1, 0, 'two-step-verification', 'two_step_verification', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (307, 'theme', 'default', 0, 0, 'default', 'default', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (311, 'theme', 'mobile_default', 0, 0, 'mobile_default', 'mobile_default', '4.3.03 1533549600', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (0, 'module', 'about', 0, 0, 'page', 'about', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (0, 'module', 'siteterms', 0, 0, 'page', 'siteterms', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (19, 'module', 'banners', 1, 0, 'banners', 'banners', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (20, 'module', 'contact', 0, 1, 'contact', 'contact', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (1, 'module', 'news', 0, 1, 'news', 'news', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (21, 'module', 'voting', 0, 0, 'voting', 'voting', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (22, 'module', 'forum', 0, 0, 'forum', 'forum', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (284, 'module', 'seek', 1, 0, 'seek', 'seek', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (24, 'module', 'users', 1, 1, 'users', 'users', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (27, 'module', 'statistics', 0, 0, 'statistics', 'statistics', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (29, 'module', 'menu', 0, 0, 'menu', 'menu', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (283, 'module', 'feeds', 1, 0, 'feeds', 'feeds', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (282, 'module', 'page', 1, 1, 'page', 'page', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (281, 'module', 'comment', 1, 0, 'comment', 'comment', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (312, 'module', 'freecontent', 0, 1, 'freecontent', 'freecontent', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (327, 'module', 'two-step-verification', 1, 0, 'two-step-verification', 'two_step_verification', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (307, 'theme', 'default', 0, 0, 'default', 'default', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_setup_extensions (id, type, title, is_sys, is_virtual, basename, table_prefix, version, addtime, author, note) VALUES (311, 'theme', 'mobile_default', 0, 0, 'mobile_default', 'mobile_default', '4.3.04 1542337256', " . NV_CURRENTTIME . ", 'VINADES <contact@vinades.vn>', '')"; $sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_banners_plans (id, blang, title, description, form, width, height, act, require_image, uploadtype) VALUES (1, '', 'Quang cao giua trang', '', 'sequential', 575, 72, 1, 1, 'images,flash')"; $sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_banners_plans (id, blang, title, description, form, width, height, act, require_image, uploadtype) VALUES (2, '', 'Quang cao trai', '', 'sequential', 212, 800, 1, 1, 'images,flash')"; @@ -177,4 +177,4 @@ $sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_banners_rows (id, title, pid, clid, file_name, file_ext, file_mime, width, height, file_alt, imageforswf, click_url, target, bannerhtml, add_time, publ_time, exp_time, hits_total, act, weight) VALUES (3, 'Quang cao giua trang', 1, 1, 'webnhanh.jpg', 'png', 'image/jpeg', 575, 72, '', '', 'http://webnhanh.vn', '_blank', '', " . NV_CURRENTTIME . ", " . NV_CURRENTTIME . ", 0, 0, 1, 1)"; $sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_plugin (pid, plugin_file, plugin_area, weight) VALUES (1, 'qrcode.php', 1, 1)"; -$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_plugin (pid, plugin_file, plugin_area, weight) VALUES (2, 'cdn_js_css_image.php', 3, 1)"; \ No newline at end of file +$sql_create_table[] = "INSERT INTO " . $db_config['prefix'] . "_plugin (pid, plugin_file, plugin_area, weight) VALUES (2, 'cdn_js_css_image.php', 3, 1)";
modules/banners/version.php+2 −2 modified@@ -17,8 +17,8 @@ 'modfuncs' => 'main, addads, stats', 'is_sysmod' => 1, 'virtual' => 0, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '', 'uploads_dir' => array(
modules/comment/version.php+2 −2 modified@@ -18,8 +18,8 @@ 'submenu' => '', 'is_sysmod' => 0, 'virtual' => 0, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'uploads_dir' => array($module_upload), 'note' => ''
modules/contact/version.php+2 −2 modified@@ -17,8 +17,8 @@ 'modfuncs' => 'main', 'is_sysmod' => 0, 'virtual' => 1, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '', 'uploads_dir' => array(
modules/feeds/version.php+2 −2 modified@@ -17,8 +17,8 @@ 'modfuncs' => 'main', 'is_sysmod' => 1, 'virtual' => 0, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '' );
modules/freecontent/version.php+2 −2 modified@@ -17,8 +17,8 @@ 'modfuncs' => '', 'is_sysmod' => 0, 'virtual' => 0, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '', 'uploads_dir' => array(
modules/menu/version.php+2 −2 modified@@ -14,8 +14,8 @@ 'submenu' => '', 'is_sysmod' => 1, 'virtual' => 0, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '', 'uploads_dir' => array(
modules/news/version.php+2 −2 modified@@ -19,8 +19,8 @@ 'submenu' => 'content,rss,search', 'is_sysmod' => 0, // 1:0 => Co phai la module he thong hay khong 'virtual' => 1, // 1:0 => Co cho phep ao hao module hay khong - 'version' => '4.3.03', // Phien ban cua modle - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', // Ngay phat hanh phien ban + 'version' => '4.3.04', // Phien ban cua modle + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', // Ngay phat hanh phien ban 'author' => 'VINADES <contact@vinades.vn>', // Tac gia 'note' => '', // Ghi chu 'uploads_dir' => array(
modules/page/version.php+2 −2 modified@@ -17,8 +17,8 @@ 'modfuncs' => 'main,rss', 'is_sysmod' => 1, 'virtual' => 1, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '', 'uploads_dir' => array(
modules/seek/version.php+2 −2 modified@@ -17,8 +17,8 @@ 'modfuncs' => 'main', 'is_sysmod' => 1, 'virtual' => 0, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '' ); \ No newline at end of file
modules/statistics/version.php+2 −2 modified@@ -20,8 +20,8 @@ 'layoutdefault' => 'body:main,allreferers,allcountries,allbrowsers,allos,allbots', 'is_sysmod' => 0, 'virtual' => 2, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '' ); \ No newline at end of file
modules/two-step-verification/version.php+2 −2 modified@@ -18,8 +18,8 @@ 'submenu' => 'main,setup,confirm', 'is_sysmod' => 1, 'virtual' => 0, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => 'Two-Step Verification' ); \ No newline at end of file
modules/users/version.php+2 −2 modified@@ -18,8 +18,8 @@ 'submenu' => 'main,login,logout,register,lostpass,active,editinfo,lostactivelink,memberlist', 'is_sysmod' => 1, 'virtual' => 1, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '' ); \ No newline at end of file
modules/voting/version.php+2 −2 modified@@ -17,8 +17,8 @@ 'modfuncs' => 'main', 'is_sysmod' => 0, 'virtual' => 0, - 'version' => '4.3.03', - 'date' => 'Monday, August 6, 2018 5:00:00 PM GMT+07:00', + 'version' => '4.3.04', + 'date' => 'Friday, November 16, 2018 9:59:52 AM GMT+07:00', 'author' => 'VINADES <contact@vinades.vn>', 'note' => '' ); \ No newline at end of file
0a0f643988a3Merge pull request #2740 from vuthao/nukeviet4.3
45 files changed · +316 −3449
admin/settings/security.php+1 −1 modified@@ -30,7 +30,7 @@ 7 => $lang_module['captcha_7'] ); -$captcha_type_array = array(0 => $lang_module['captcha_type_0'], 1 => $lang_module['captcha_type_1'], 2 => $lang_module['captcha_type_2']); +$captcha_type_array = array(0 => $lang_module['captcha_type_0'], 2 => $lang_module['captcha_type_2']); $recaptcha_type_array = array('image' => $lang_module['recaptcha_type_image'], 'audio' => $lang_module['recaptcha_type_audio']); $errormess = '';
composer.json+1 −2 modified@@ -30,7 +30,6 @@ "pclzip/pclzip": "^2.8", "endroid/qrcode": "^1.9.1", "true/punycode": "^2.1", - "phpmailer/phpmailer": "^6.0", - "gregwar/captcha": "^1.1" + "phpmailer/phpmailer": "^6.0" } }
includes/core/captcha.php+1 −6 modified@@ -21,12 +21,7 @@ $rcode = strtoupper(md5(NV_USER_AGENT . $global_config['sitekey'] . $random_num . $datekey)); $code = substr($rcode, 2, NV_GFX_NUM); -if ($global_config['captcha_type'] === 1) { - $builder = new Gregwar\Captcha\CaptchaBuilder($code); - $builder->build(NV_GFX_WIDTH, NV_GFX_HEIGHT); - header('Content-type: image/jpeg'); - $builder->output(); -} elseif ($global_config['captcha_type'] === 0) { +if ($global_config['captcha_type'] === 0) { $image = imagecreate(NV_GFX_WIDTH, NV_GFX_HEIGHT); $bgc = imagecolorallocate($image, 240, 240, 240); imagefilledrectangle($image, 0, 0, NV_GFX_WIDTH, NV_GFX_HEIGHT, $bgc);
includes/core/is_user.php+2 −3 modified@@ -50,11 +50,10 @@ if ($nv_Request->get_bool('nvloginhash', 'cookie', false)) { $user = $nv_Request->get_string('nvloginhash', 'cookie', ''); if (!empty($user) and $global_config['allowuserlogin']) { - $user = unserialize($user); - + $user = json_decode($user, true); if (isset($user['userid']) and isset($user['checknum']) and isset($user['checkhash'])) { $user['userid'] = intval($user['userid']); - if ($user['checkhash'] == md5($user['userid'] . $user['checknum'] . $global_config['sitekey'] . $client_info['browser']['key'])) { + if ($user['checkhash'] === md5($user['userid'] . $user['checknum'] . $global_config['sitekey'] . $client_info['browser']['key'])) { $_sql = 'SELECT userid, group_id, username, email, first_name, last_name, gender, photo, birthday, regdate, view_mail, remember, in_groups, active2step, checknum, last_agent AS current_agent, last_ip AS current_ip, last_login AS current_login, last_openid AS current_openid, password, question, answer, safemode, email_verification_time
modules/banners/funcs/click.php+1 −2 modified@@ -7,7 +7,6 @@ * @License GNU/GPL version 2 or any later version * @Createdate 3-6-2010 0:19 */ - if (!defined('NV_IS_MOD_BANNERS')) { die('Stop!!!'); } @@ -29,7 +28,7 @@ $db->query('UPDATE ' . NV_BANNERS_GLOBALTABLE . '_rows SET hits_total=hits_total+1 WHERE id=' . $id); $sql = "INSERT INTO " . NV_BANNERS_GLOBALTABLE . "_click (bid, click_time, click_day, click_ip, click_country, click_browse_key, click_browse_name, click_os_key, click_os_name, click_ref) - VALUES (" . $id . ", " . NV_CURRENTTIME . ", 0, '" . $client_info['ip'] . "', '" . $client_info['country'] . "', '', '" . $browser . "', '','" . $client_info['client_os']['name'] . "','" . $client_info['referer'] . "');"; + VALUES (" . $id . ", " . NV_CURRENTTIME . ", 0, " . $db->quote($client_info['ip']) . ", " . $db->quote($client_info['country']) . ", '', " . $db->quote($browser) . ", '', " . $db->quote($client_info['client_os']['name']) . ", " . $db->quote($client_info['referer']) . ");"; $db->query($sql); } }
modules/users/functions.php+1 −1 modified@@ -64,7 +64,7 @@ function validUserLog($array_user, $remember, $opid, $current_mode = 0) $stmt->execute(); $live_cookie_time = ($remember) ? NV_LIVE_COOKIE_TIME : 0; - $nv_Request->set_Cookie('nvloginhash', serialize($user), $live_cookie_time); + $nv_Request->set_Cookie('nvloginhash', json_encode($user), $live_cookie_time); if (!empty($global_users_config['active_user_logs'])) { $log_message = $opid ? ($lang_module['userloginviaopt'] . ' ' . $opid) : $lang_module['st_login'];
vendor/composer/autoload_psr4.php+0 −2 modified@@ -9,11 +9,9 @@ 'TrueBV\\' => array($vendorDir . '/true/punycode/src'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'), - 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), 'OAuth\\' => array($vendorDir . '/and/oauth/src'), 'NukeViet\\' => array($vendorDir . '/vinades/nukeviet'), 'League\\Url\\' => array($vendorDir . '/league/url/src'), - 'Gregwar\\' => array($vendorDir . '/gregwar/captcha/src/Gregwar'), 'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qrcode/src'), );
vendor/composer/autoload_real.php+1 −1 modified@@ -23,7 +23,7 @@ public static function getLoader() self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInit8c9f50366561a5497ebe188ba93ba4da', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php';
vendor/composer/autoload_static.php+0 −13 modified@@ -19,7 +19,6 @@ class ComposerStaticInit8c9f50366561a5497ebe188ba93ba4da array ( 'Symfony\\Polyfill\\Mbstring\\' => 26, 'Symfony\\Component\\OptionsResolver\\' => 34, - 'Symfony\\Component\\Finder\\' => 25, ), 'P' => array ( @@ -37,10 +36,6 @@ class ComposerStaticInit8c9f50366561a5497ebe188ba93ba4da array ( 'League\\Url\\' => 11, ), - 'G' => - array ( - 'Gregwar\\' => 8, - ), 'E' => array ( 'Endroid\\QrCode\\' => 15, @@ -60,10 +55,6 @@ class ComposerStaticInit8c9f50366561a5497ebe188ba93ba4da array ( 0 => __DIR__ . '/..' . '/symfony/options-resolver', ), - 'Symfony\\Component\\Finder\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/finder', - ), 'PHPMailer\\PHPMailer\\' => array ( 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', @@ -80,10 +71,6 @@ class ComposerStaticInit8c9f50366561a5497ebe188ba93ba4da array ( 0 => __DIR__ . '/..' . '/league/url/src', ), - 'Gregwar\\' => - array ( - 0 => __DIR__ . '/..' . '/gregwar/captcha/src/Gregwar', - ), 'Endroid\\QrCode\\' => array ( 0 => __DIR__ . '/..' . '/endroid/qrcode/src',
vendor/composer/ClassLoader.php+39 −9 modified@@ -55,6 +55,7 @@ class ClassLoader private $classMap = array(); private $classMapAuthoritative = false; private $missingClasses = array(); + private $apcuPrefix; public function getPrefixes() { @@ -271,6 +272,26 @@ public function isClassMapAuthoritative() return $this->classMapAuthoritative; } + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + /** * Registers this instance as an autoloader. * @@ -313,18 +334,19 @@ public function loadClass($class) */ public function findFile($class) { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } $file = $this->findFileWithExtension($class, '.php'); @@ -333,6 +355,10 @@ public function findFile($class) $file = $this->findFileWithExtension($class, '.hh'); } + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + if (false === $file) { // Remember that this class does not exist. $this->missingClasses[$class] = true; @@ -348,10 +374,14 @@ private function findFileWithExtension($class, $ext) $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { - foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { - if (0 === strpos($class, $prefix)) { - foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { return $file; } }
vendor/composer/installed.json+262 −368 modified@@ -1,111 +1,4 @@ [ - { - "name": "league/url", - "version": "3.3.5", - "version_normalized": "3.3.5.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/url.git", - "reference": "1ae2c3ce29a7c5438339ff6388225844e6479da8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/url/zipball/1ae2c3ce29a7c5438339ff6388225844e6479da8", - "reference": "1ae2c3ce29a7c5438339ff6388225844e6479da8", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.3.0", - "true/punycode": "^2.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "time": "2015-07-15 08:24:12", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Url\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ignace Nyamagana Butera", - "email": "nyamsprod@gmail.com", - "homepage": "https://github.com/nyamsprod/", - "role": "Developer" - } - ], - "description": "League/url is a lightweight PHP Url manipulating library", - "homepage": "http://url.thephpleague.com", - "keywords": [ - "parse_url", - "php", - "url" - ], - "abandoned": "league/uri" - }, - { - "name": "kriswallsmith/buzz", - "version": "v0.15", - "version_normalized": "0.15.0.0", - "source": { - "type": "git", - "url": "https://github.com/kriswallsmith/Buzz.git", - "reference": "d4041666c3ffb379af02a92dabe81c904b35fab8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kriswallsmith/Buzz/zipball/d4041666c3ffb379af02a92dabe81c904b35fab8", - "reference": "d4041666c3ffb379af02a92dabe81c904b35fab8", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*" - }, - "suggest": { - "ext-curl": "*" - }, - "time": "2015-06-25 17:26:56", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Buzz": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kris Wallsmith", - "email": "kris.wallsmith@gmail.com", - "homepage": "http://kriswallsmith.net/" - } - ], - "description": "Lightweight HTTP client", - "homepage": "https://github.com/kriswallsmith/Buzz", - "keywords": [ - "curl", - "http client" - ] - }, { "name": "and/oauth", "version": "dev-master", @@ -139,7 +32,7 @@ "predis/predis": "Allows using the Redis storage backend.", "symfony/http-foundation": "Allows using the Symfony Session storage backend." }, - "time": "2015-10-25 10:42:13", + "time": "2015-10-25T10:42:13+00:00", "type": "library", "extra": { "branch-alias": { @@ -224,91 +117,6 @@ "yahoo" ] }, - { - "name": "pclzip/pclzip", - "version": "2.8.2", - "version_normalized": "2.8.2.0", - "source": { - "type": "git", - "url": "https://github.com/ivanlanin/pclzip.git", - "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ivanlanin/pclzip/zipball/19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", - "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", - "shasum": "" - }, - "time": "2014-06-05 11:42:24", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "pclzip.lib.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Vincent Blavet" - } - ], - "description": "A PHP library that offers compression and extraction functions for Zip formatted archives", - "homepage": "http://www.phpconcept.net/pclzip", - "keywords": [ - "php", - "zip" - ] - }, - { - "name": "vinades/nukeviet", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/vinades/nukeviet.git", - "reference": "44dbcfcae7bd590921805db13e1d1db1e3253671" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vinades/nukeviet/zipball/44dbcfcae7bd590921805db13e1d1db1e3253671", - "reference": "44dbcfcae7bd590921805db13e1d1db1e3253671", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "time": "2015-12-30 17:16:23", - "type": "project", - "installation-source": "dist", - "autoload": { - "psr-4": { - "NukeViet\\": "/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0+" - ], - "authors": [ - { - "name": "VINADES.,JSC", - "email": "contact@vinades.vn", - "homepage": "http://vinades.vn", - "role": "Developer" - } - ], - "description": "class for NukeViet 4", - "homepage": "https://github.com/nukeviet/nukeviet", - "keywords": [ - "cms", - "nukeviet", - "nukeviet4" - ] - }, { "name": "endroid/qrcode", "version": "1.9.1", @@ -336,7 +144,7 @@ "symfony/framework-bundle": "^2.3|^3.0", "symfony/http-kernel": "^2.3|^3.0" }, - "time": "2017-01-03 11:02:14", + "time": "2017-01-03T11:02:14+00:00", "type": "library", "extra": { "branch-alias": { @@ -373,95 +181,84 @@ "abandoned": "endroid/qr-code" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", + "name": "gregwar/cache", + "version": "v1.0.12", + "version_normalized": "1.0.12.0", + "target-dir": "Gregwar/Cache", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + "url": "https://github.com/Gregwar/Cache.git", + "reference": "305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", - "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "url": "https://api.github.com/repos/Gregwar/Cache/zipball/305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3", + "reference": "305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" + "php": ">=5.3" }, - "time": "2016-11-14 01:06:16", + "time": "2016-09-23T08:16:04+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] + "psr-0": { + "Gregwar\\Cache": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Gregwar", + "email": "g.passault@gmail.com" } ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", + "description": "A lightweight file-system cache system", "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "cache", + "caching", + "file-system", + "system" ] }, { - "name": "true/punycode", - "version": "v2.1.1", - "version_normalized": "2.1.1.0", + "name": "gregwar/image", + "version": "v2.0.21", + "version_normalized": "2.0.21.0", + "target-dir": "Gregwar/Image", "source": { "type": "git", - "url": "https://github.com/true/php-punycode.git", - "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e" + "url": "https://github.com/Gregwar/Image.git", + "reference": "c9899e4c71009338f89a8c63c12c681692533ede" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/true/php-punycode/zipball/a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", - "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", - "shasum": "" + "url": "https://api.github.com/repos/Gregwar/Image/zipball/c9899e4c71009338f89a8c63c12c681692533ede", + "reference": "c9899e4c71009338f89a8c63c12c681692533ede", + "shasum": "" }, "require": { - "php": ">=5.3.0", - "symfony/polyfill-mbstring": "^1.3" + "ext-gd": "*", + "gregwar/cache": "^1.0.6", + "php": "^5.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.7", - "squizlabs/php_codesniffer": "~2.0" + "sllh/php-cs-fixer-styleci-bridge": "~1.0", + "symfony/phpunit-bridge": "^2.7.4 || ^3.0" + }, + "suggest": { + "behat/transliterator": "Transliterator provides ability to set non-latin1 pretty names" }, - "time": "2016-11-16 10:37:54", + "time": "2017-01-24T09:29:39+00:00", "type": "library", "installation-source": "dist", "autoload": { - "psr-4": { - "TrueBV\\": "src/" + "psr-0": { + "Gregwar\\Image": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -470,42 +267,48 @@ ], "authors": [ { - "name": "Renan Gonçalves", - "email": "renan.saddam@gmail.com" + "name": "Grégoire Passault", + "email": "g.passault@gmail.com", + "homepage": "http://www.gregwar.com/" } ], - "description": "A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)", - "homepage": "https://github.com/true/php-punycode", + "description": "Image handling", + "homepage": "https://github.com/Gregwar/Image", "keywords": [ - "idna", - "punycode" + "gd", + "image" ] }, { - "name": "gregwar/cache", - "version": "v1.0.12", - "version_normalized": "1.0.12.0", - "target-dir": "Gregwar/Cache", + "name": "kriswallsmith/buzz", + "version": "v0.15", + "version_normalized": "0.15.0.0", "source": { "type": "git", - "url": "https://github.com/Gregwar/Cache.git", - "reference": "305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3" + "url": "https://github.com/kriswallsmith/Buzz.git", + "reference": "d4041666c3ffb379af02a92dabe81c904b35fab8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Gregwar/Cache/zipball/305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3", - "reference": "305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3", + "url": "https://api.github.com/repos/kriswallsmith/Buzz/zipball/d4041666c3ffb379af02a92dabe81c904b35fab8", + "reference": "d4041666c3ffb379af02a92dabe81c904b35fab8", "shasum": "" }, "require": { - "php": ">=5.3" + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*" + }, + "suggest": { + "ext-curl": "*" }, - "time": "2016-09-23 08:16:04", + "time": "2015-06-25T17:26:56+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-0": { - "Gregwar\\Cache": "" + "Buzz": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -514,52 +317,52 @@ ], "authors": [ { - "name": "Gregwar", - "email": "g.passault@gmail.com" + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" } ], - "description": "A lightweight file-system cache system", + "description": "Lightweight HTTP client", + "homepage": "https://github.com/kriswallsmith/Buzz", "keywords": [ - "cache", - "caching", - "file-system", - "system" + "curl", + "http client" ] }, { - "name": "gregwar/image", - "version": "v2.0.21", - "version_normalized": "2.0.21.0", - "target-dir": "Gregwar/Image", + "name": "league/url", + "version": "3.3.5", + "version_normalized": "3.3.5.0", "source": { "type": "git", - "url": "https://github.com/Gregwar/Image.git", - "reference": "c9899e4c71009338f89a8c63c12c681692533ede" + "url": "https://github.com/thephpleague/url.git", + "reference": "1ae2c3ce29a7c5438339ff6388225844e6479da8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Gregwar/Image/zipball/c9899e4c71009338f89a8c63c12c681692533ede", - "reference": "c9899e4c71009338f89a8c63c12c681692533ede", + "url": "https://api.github.com/repos/thephpleague/url/zipball/1ae2c3ce29a7c5438339ff6388225844e6479da8", + "reference": "1ae2c3ce29a7c5438339ff6388225844e6479da8", "shasum": "" }, "require": { - "ext-gd": "*", - "gregwar/cache": "^1.0.6", - "php": "^5.3 || ^7.0" + "ext-mbstring": "*", + "php": ">=5.3.0", + "true/punycode": "^2.0" }, "require-dev": { - "sllh/php-cs-fixer-styleci-bridge": "~1.0", - "symfony/phpunit-bridge": "^2.7.4 || ^3.0" - }, - "suggest": { - "behat/transliterator": "Transliterator provides ability to set non-latin1 pretty names" + "phpunit/phpunit": "^4.0" }, - "time": "2017-01-24 09:29:39", + "time": "2015-07-15T08:24:12+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, "installation-source": "dist", "autoload": { - "psr-0": { - "Gregwar\\Image": "" + "psr-4": { + "League\\Url\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -568,72 +371,58 @@ ], "authors": [ { - "name": "Grégoire Passault", - "email": "g.passault@gmail.com", - "homepage": "http://www.gregwar.com/" + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://github.com/nyamsprod/", + "role": "Developer" } ], - "description": "Image handling", - "homepage": "https://github.com/Gregwar/Image", + "description": "League/url is a lightweight PHP Url manipulating library", + "homepage": "http://url.thephpleague.com", "keywords": [ - "gd", - "image" - ] + "parse_url", + "php", + "url" + ], + "abandoned": "league/uri" }, { - "name": "symfony/options-resolver", - "version": "v3.2.6", - "version_normalized": "3.2.6.0", + "name": "pclzip/pclzip", + "version": "2.8.2", + "version_normalized": "2.8.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "56e3d0a41313f8a54326851f10690d591e62a24c" + "url": "https://github.com/ivanlanin/pclzip.git", + "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/56e3d0a41313f8a54326851f10690d591e62a24c", - "reference": "56e3d0a41313f8a54326851f10690d591e62a24c", + "url": "https://api.github.com/repos/ivanlanin/pclzip/zipball/19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", + "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", "shasum": "" }, - "require": { - "php": ">=5.5.9" - }, - "time": "2017-02-21 09:12:04", + "time": "2014-06-05T11:42:24+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "pclzip.lib.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL-2.1" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Vincent Blavet" } ], - "description": "Symfony OptionsResolver Component", - "homepage": "https://symfony.com", + "description": "A PHP library that offers compression and extraction functions for Zip formatted archives", + "homepage": "http://www.phpconcept.net/pclzip", "keywords": [ - "config", - "configuration", - "options" + "php", + "zip" ] }, { @@ -673,7 +462,7 @@ "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, - "time": "2018-03-27 13:49:45", + "time": "2018-03-27T13:49:45+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -705,34 +494,34 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP" }, { - "name": "symfony/finder", - "version": "v4.1.2", - "version_normalized": "4.1.2.0", + "name": "symfony/options-resolver", + "version": "v3.2.6", + "version_normalized": "3.2.6.0", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "56e3d0a41313f8a54326851f10690d591e62a24c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb", - "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/56e3d0a41313f8a54326851f10690d591e62a24c", + "reference": "56e3d0a41313f8a54326851f10690d591e62a24c", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=5.5.9" }, - "time": "2018-06-19 21:38:16", + "time": "2017-02-21T09:12:04+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "3.2-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Component\\OptionsResolver\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -752,39 +541,104 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com" + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ] }, { - "name": "gregwar/captcha", - "version": "v1.1.6", - "version_normalized": "1.1.6.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", - "url": "https://github.com/Gregwar/Captcha.git", - "reference": "a96d8dffc80d6213958bd19fbdef1555e8b63ca3" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Gregwar/Captcha/zipball/a96d8dffc80d6213958bd19fbdef1555e8b63ca3", - "reference": "a96d8dffc80d6213958bd19fbdef1555e8b63ca3", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2016-11-14T01:06:16+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ] + }, + { + "name": "true/punycode", + "version": "v2.1.1", + "version_normalized": "2.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/true/php-punycode.git", + "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/true/php-punycode/zipball/a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", + "reference": "a4d0c11a36dd7f4e7cd7096076cab6d3378a071e", "shasum": "" }, "require": { - "ext-gd": "*", - "ext-mbstring": "*", "php": ">=5.3.0", - "symfony/finder": "~3.0|~4.0" + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "~4.7", + "squizlabs/php_codesniffer": "~2.0" }, - "time": "2018-04-24 09:20:08", - "type": "captcha", + "time": "2016-11-16T10:37:54+00:00", + "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Gregwar\\": "src/Gregwar" + "TrueBV\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -793,21 +647,61 @@ ], "authors": [ { - "name": "Grégoire Passault", - "email": "g.passault@gmail.com", - "homepage": "http://www.gregwar.com/" - }, + "name": "Renan Gonçalves", + "email": "renan.saddam@gmail.com" + } + ], + "description": "A Bootstring encoding of Unicode for Internationalized Domain Names in Applications (IDNA)", + "homepage": "https://github.com/true/php-punycode", + "keywords": [ + "idna", + "punycode" + ] + }, + { + "name": "vinades/nukeviet", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/vinades/nukeviet.git", + "reference": "44dbcfcae7bd590921805db13e1d1db1e3253671" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vinades/nukeviet/zipball/44dbcfcae7bd590921805db13e1d1db1e3253671", + "reference": "44dbcfcae7bd590921805db13e1d1db1e3253671", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "time": "2015-12-30T17:16:23+00:00", + "type": "project", + "installation-source": "dist", + "autoload": { + "psr-4": { + "NukeViet\\": "/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ { - "name": "Jeremy Livingston", - "email": "jeremy.j.livingston@gmail.com" + "name": "VINADES.,JSC", + "email": "contact@vinades.vn", + "homepage": "http://vinades.vn", + "role": "Developer" } ], - "description": "Captcha generator", - "homepage": "https://github.com/Gregwar/Captcha", + "description": "class for NukeViet 4", + "homepage": "https://github.com/nukeviet/nukeviet", "keywords": [ - "bot", - "captcha", - "spam" + "cms", + "nukeviet", + "nukeviet4" ] } ]
vendor/composer/LICENSE+1 −3 modified@@ -1,5 +1,4 @@ - -Copyright (c) 2016 Nils Adermann, Jordi Boggiano +Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -
vendor/gregwar/captcha/LICENSE+0 −19 removed@@ -1,19 +0,0 @@ -Copyright (c) <2012-2017> Grégoire Passault - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.
vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilderInterface.php+0 −29 removed@@ -1,29 +0,0 @@ -<?php - -namespace Gregwar\Captcha; - -/** - * A Captcha builder - */ -interface CaptchaBuilderInterface -{ - /** - * Builds the code - */ - public function build($width, $height, $font, $fingerprint); - - /** - * Saves the code to a file - */ - public function save($filename, $quality); - - /** - * Gets the image contents - */ - public function get($quality); - - /** - * Outputs the image - */ - public function output($quality); -}
vendor/gregwar/captcha/src/Gregwar/Captcha/CaptchaBuilder.php+0 −717 removed@@ -1,717 +0,0 @@ -<?php - -namespace Gregwar\Captcha; - -use \Exception; - -/** - * Builds a new captcha image - * Uses the fingerprint parameter, if one is passed, to generate the same image - * - * @author Gregwar <g.passault@gmail.com> - * @author Jeremy Livingston <jeremy.j.livingston@gmail.com> - */ -class CaptchaBuilder implements CaptchaBuilderInterface -{ - /** - * @var array - */ - protected $fingerprint = array(); - - /** - * @var bool - */ - protected $useFingerprint = false; - - /** - * @var array - */ - protected $textColor = array(); - - /** - * @var array - */ - protected $backgroundColor = null; - - /** - * @var array - */ - protected $backgroundImages = array(); - - /** - * @var resource - */ - protected $contents = null; - - /** - * @var string - */ - protected $phrase = null; - - /** - * @var PhraseBuilderInterface - */ - protected $builder; - - /** - * @var bool - */ - protected $distortion = true; - - /** - * The maximum number of lines to draw in front of - * the image. null - use default algorithm - */ - protected $maxFrontLines = null; - - /** - * The maximum number of lines to draw behind - * the image. null - use default algorithm - */ - protected $maxBehindLines = null; - - /** - * The maximum angle of char - */ - protected $maxAngle = 8; - - /** - * The maximum offset of char - */ - protected $maxOffset = 5; - - /** - * Is the interpolation enabled ? - * - * @var bool - */ - protected $interpolation = true; - - /** - * Ignore all effects - * - * @var bool - */ - protected $ignoreAllEffects = false; - - /** - * Allowed image types for the background images - * - * @var array - */ - protected $allowedBackgroundImageTypes = array('image/png', 'image/jpeg', 'image/gif'); - - /** - * The image contents - */ - public function getContents() - { - return $this->contents; - } - - /** - * Enable/Disables the interpolation - * - * @param $interpolate bool True to enable, false to disable - * - * @return CaptchaBuilder - */ - public function setInterpolation($interpolate = true) - { - $this->interpolation = $interpolate; - - return $this; - } - - /** - * Temporary dir, for OCR check - */ - public $tempDir = 'temp/'; - - public function __construct($phrase = null, PhraseBuilderInterface $builder = null) - { - if ($builder === null) { - $this->builder = new PhraseBuilder; - } else { - $this->builder = $builder; - } - - $this->phrase = is_string($phrase) ? $phrase : $this->builder->build($phrase); - } - - /** - * Setting the phrase - */ - public function setPhrase($phrase) - { - $this->phrase = (string) $phrase; - } - - /** - * Enables/disable distortion - */ - public function setDistortion($distortion) - { - $this->distortion = (bool) $distortion; - - return $this; - } - - public function setMaxBehindLines($maxBehindLines) - { - $this->maxBehindLines = $maxBehindLines; - - return $this; - } - - public function setMaxFrontLines($maxFrontLines) - { - $this->maxFrontLines = $maxFrontLines; - - return $this; - } - - public function setMaxAngle($maxAngle) - { - $this->maxAngle = $maxAngle; - - return $this; - } - - public function setMaxOffset($maxOffset) - { - $this->maxOffset = $maxOffset; - - return $this; - } - - /** - * Gets the captcha phrase - */ - public function getPhrase() - { - return $this->phrase; - } - - /** - * Returns true if the given phrase is good - */ - public function testPhrase($phrase) - { - return ($this->builder->niceize($phrase) == $this->builder->niceize($this->getPhrase())); - } - - /** - * Instantiation - */ - public static function create($phrase = null) - { - return new self($phrase); - } - - /** - * Sets the text color to use - */ - public function setTextColor($r, $g, $b) - { - $this->textColor = array($r, $g, $b); - - return $this; - } - - /** - * Sets the background color to use - */ - public function setBackgroundColor($r, $g, $b) - { - $this->backgroundColor = array($r, $g, $b); - - return $this; - } - - /** - * Sets the ignoreAllEffects value - * - * @param bool $ignoreAllEffects - * @return CaptchaBuilder - */ - public function setIgnoreAllEffects($ignoreAllEffects) - { - $this->ignoreAllEffects = $ignoreAllEffects; - - return $this; - } - - /** - * Sets the list of background images to use (one image is randomly selected) - */ - public function setBackgroundImages(array $backgroundImages) - { - $this->backgroundImages = $backgroundImages; - - return $this; - } - - /** - * Draw lines over the image - */ - protected function drawLine($image, $width, $height, $tcol = null) - { - if ($tcol === null) { - $tcol = imagecolorallocate($image, $this->rand(100, 255), $this->rand(100, 255), $this->rand(100, 255)); - } - - if ($this->rand(0, 1)) { // Horizontal - $Xa = $this->rand(0, $width/2); - $Ya = $this->rand(0, $height); - $Xb = $this->rand($width/2, $width); - $Yb = $this->rand(0, $height); - } else { // Vertical - $Xa = $this->rand(0, $width); - $Ya = $this->rand(0, $height/2); - $Xb = $this->rand(0, $width); - $Yb = $this->rand($height/2, $height); - } - imagesetthickness($image, $this->rand(1, 3)); - imageline($image, $Xa, $Ya, $Xb, $Yb, $tcol); - } - - /** - * Apply some post effects - */ - protected function postEffect($image) - { - if (!function_exists('imagefilter')) { - return; - } - - if ($this->backgroundColor != null || $this->textColor != null) { - return; - } - - // Negate ? - if ($this->rand(0, 1) == 0) { - imagefilter($image, IMG_FILTER_NEGATE); - } - - // Edge ? - if ($this->rand(0, 10) == 0) { - imagefilter($image, IMG_FILTER_EDGEDETECT); - } - - // Contrast - imagefilter($image, IMG_FILTER_CONTRAST, $this->rand(-50, 10)); - - // Colorize - if ($this->rand(0, 5) == 0) { - imagefilter($image, IMG_FILTER_COLORIZE, $this->rand(-80, 50), $this->rand(-80, 50), $this->rand(-80, 50)); - } - } - - /** - * Writes the phrase on the image - */ - protected function writePhrase($image, $phrase, $font, $width, $height) - { - $length = mb_strlen($phrase); - if ($length === 0) { - return \imagecolorallocate($image, 0, 0, 0); - } - - // Gets the text size and start position - $size = $width / $length - $this->rand(0, 3) - 1; - $box = \imagettfbbox($size, 0, $font, $phrase); - $textWidth = $box[2] - $box[0]; - $textHeight = $box[1] - $box[7]; - $x = ($width - $textWidth) / 2; - $y = ($height - $textHeight) / 2 + $size; - - if (!$this->textColor) { - $textColor = array($this->rand(0, 150), $this->rand(0, 150), $this->rand(0, 150)); - } else { - $textColor = $this->textColor; - } - $col = \imagecolorallocate($image, $textColor[0], $textColor[1], $textColor[2]); - - // Write the letters one by one, with random angle - for ($i=0; $i<$length; $i++) { - $symbol = mb_substr($phrase, $i, 1); - $box = \imagettfbbox($size, 0, $font, $symbol); - $w = $box[2] - $box[0]; - $angle = $this->rand(-$this->maxAngle, $this->maxAngle); - $offset = $this->rand(-$this->maxOffset, $this->maxOffset); - \imagettftext($image, $size, $angle, $x, $y + $offset, $col, $font, $symbol); - $x += $w; - } - - return $col; - } - - /** - * Try to read the code against an OCR - */ - public function isOCRReadable() - { - if (!is_dir($this->tempDir)) { - @mkdir($this->tempDir, 0755, true); - } - - $tempj = $this->tempDir . uniqid('captcha', true) . '.jpg'; - $tempp = $this->tempDir . uniqid('captcha', true) . '.pgm'; - - $this->save($tempj); - shell_exec("convert $tempj $tempp"); - $value = trim(strtolower(shell_exec("ocrad $tempp"))); - - @unlink($tempj); - @unlink($tempp); - - return $this->testPhrase($value); - } - - /** - * Builds while the code is readable against an OCR - */ - public function buildAgainstOCR($width = 150, $height = 40, $font = null, $fingerprint = null) - { - do { - $this->build($width, $height, $font, $fingerprint); - } while ($this->isOCRReadable()); - } - - /** - * Generate the image - */ - public function build($width = 150, $height = 40, $font = null, $fingerprint = null) - { - if (null !== $fingerprint) { - $this->fingerprint = $fingerprint; - $this->useFingerprint = true; - } else { - $this->fingerprint = array(); - $this->useFingerprint = false; - } - - if ($font === null) { - $font = __DIR__ . '/Font/captcha'.$this->rand(0, 5).'.ttf'; - } - - if (empty($this->backgroundImages)) { - // if background images list is not set, use a color fill as a background - $image = imagecreatetruecolor($width, $height); - if ($this->backgroundColor == null) { - $bg = imagecolorallocate($image, $this->rand(200, 255), $this->rand(200, 255), $this->rand(200, 255)); - } else { - $color = $this->backgroundColor; - $bg = imagecolorallocate($image, $color[0], $color[1], $color[2]); - } - $this->background = $bg; - imagefill($image, 0, 0, $bg); - } else { - // use a random background image - $randomBackgroundImage = $this->backgroundImages[rand(0, count($this->backgroundImages)-1)]; - - $imageType = $this->validateBackgroundImage($randomBackgroundImage); - - $image = $this->createBackgroundImageFromType($randomBackgroundImage, $imageType); - } - - // Apply effects - if (!$this->ignoreAllEffects) { - $square = $width * $height; - $effects = $this->rand($square/3000, $square/2000); - - // set the maximum number of lines to draw in front of the text - if ($this->maxBehindLines != null && $this->maxBehindLines > 0) { - $effects = min($this->maxBehindLines, $effects); - } - - if ($this->maxBehindLines !== 0) { - for ($e = 0; $e < $effects; $e++) { - $this->drawLine($image, $width, $height); - } - } - } - - // Write CAPTCHA text - $color = $this->writePhrase($image, $this->phrase, $font, $width, $height); - - // Apply effects - if (!$this->ignoreAllEffects) { - $square = $width * $height; - $effects = $this->rand($square/3000, $square/2000); - - // set the maximum number of lines to draw in front of the text - if ($this->maxFrontLines != null && $this->maxFrontLines > 0) { - $effects = min($this->maxFrontLines, $effects); - } - - if ($this->maxFrontLines !== 0) { - for ($e = 0; $e < $effects; $e++) { - $this->drawLine($image, $width, $height, $color); - } - } - } - - // Distort the image - if ($this->distortion && !$this->ignoreAllEffects) { - $image = $this->distort($image, $width, $height, $bg); - } - - // Post effects - if (!$this->ignoreAllEffects) { - $this->postEffect($image); - } - - $this->contents = $image; - - return $this; - } - - /** - * Distorts the image - */ - public function distort($image, $width, $height, $bg) - { - $contents = imagecreatetruecolor($width, $height); - $X = $this->rand(0, $width); - $Y = $this->rand(0, $height); - $phase = $this->rand(0, 10); - $scale = 1.1 + $this->rand(0, 10000) / 30000; - for ($x = 0; $x < $width; $x++) { - for ($y = 0; $y < $height; $y++) { - $Vx = $x - $X; - $Vy = $y - $Y; - $Vn = sqrt($Vx * $Vx + $Vy * $Vy); - - if ($Vn != 0) { - $Vn2 = $Vn + 4 * sin($Vn / 30); - $nX = $X + ($Vx * $Vn2 / $Vn); - $nY = $Y + ($Vy * $Vn2 / $Vn); - } else { - $nX = $X; - $nY = $Y; - } - $nY = $nY + $scale * sin($phase + $nX * 0.2); - - if ($this->interpolation) { - $p = $this->interpolate( - $nX - floor($nX), - $nY - floor($nY), - $this->getCol($image, floor($nX), floor($nY), $bg), - $this->getCol($image, ceil($nX), floor($nY), $bg), - $this->getCol($image, floor($nX), ceil($nY), $bg), - $this->getCol($image, ceil($nX), ceil($nY), $bg) - ); - } else { - $p = $this->getCol($image, round($nX), round($nY), $bg); - } - - if ($p == 0) { - $p = $bg; - } - - imagesetpixel($contents, $x, $y, $p); - } - } - - return $contents; - } - - /** - * Saves the Captcha to a jpeg file - */ - public function save($filename, $quality = 90) - { - imagejpeg($this->contents, $filename, $quality); - } - - /** - * Gets the image GD - */ - public function getGd() - { - return $this->contents; - } - - /** - * Gets the image contents - */ - public function get($quality = 90) - { - ob_start(); - $this->output($quality); - - return ob_get_clean(); - } - - /** - * Gets the HTML inline base64 - */ - public function inline($quality = 90) - { - return 'data:image/jpeg;base64,' . base64_encode($this->get($quality)); - } - - /** - * Outputs the image - */ - public function output($quality = 90) - { - imagejpeg($this->contents, null, $quality); - } - - /** - * @return array - */ - public function getFingerprint() - { - return $this->fingerprint; - } - - /** - * Returns a random number or the next number in the - * fingerprint - */ - protected function rand($min, $max) - { - if (!is_array($this->fingerprint)) { - $this->fingerprint = array(); - } - - if ($this->useFingerprint) { - $value = current($this->fingerprint); - next($this->fingerprint); - } else { - $value = mt_rand($min, $max); - $this->fingerprint[] = $value; - } - - return $value; - } - - /** - * @param $x - * @param $y - * @param $nw - * @param $ne - * @param $sw - * @param $se - * - * @return int - */ - protected function interpolate($x, $y, $nw, $ne, $sw, $se) - { - list($r0, $g0, $b0) = $this->getRGB($nw); - list($r1, $g1, $b1) = $this->getRGB($ne); - list($r2, $g2, $b2) = $this->getRGB($sw); - list($r3, $g3, $b3) = $this->getRGB($se); - - $cx = 1.0 - $x; - $cy = 1.0 - $y; - - $m0 = $cx * $r0 + $x * $r1; - $m1 = $cx * $r2 + $x * $r3; - $r = (int) ($cy * $m0 + $y * $m1); - - $m0 = $cx * $g0 + $x * $g1; - $m1 = $cx * $g2 + $x * $g3; - $g = (int) ($cy * $m0 + $y * $m1); - - $m0 = $cx * $b0 + $x * $b1; - $m1 = $cx * $b2 + $x * $b3; - $b = (int) ($cy * $m0 + $y * $m1); - - return ($r << 16) | ($g << 8) | $b; - } - - /** - * @param $image - * @param $x - * @param $y - * - * @return int - */ - protected function getCol($image, $x, $y, $background) - { - $L = imagesx($image); - $H = imagesy($image); - if ($x < 0 || $x >= $L || $y < 0 || $y >= $H) { - return $background; - } - - return imagecolorat($image, $x, $y); - } - - /** - * @param $col - * - * @return array - */ - protected function getRGB($col) - { - return array( - (int) ($col >> 16) & 0xff, - (int) ($col >> 8) & 0xff, - (int) ($col) & 0xff, - ); - } - - /** - * Validate the background image path. Return the image type if valid - * - * @param string $backgroundImage - * @return string - * @throws Exception - */ - protected function validateBackgroundImage($backgroundImage) - { - // check if file exists - if (!file_exists($backgroundImage)) { - $backgroundImageExploded = explode('/', $backgroundImage); - $imageFileName = count($backgroundImageExploded) > 1? $backgroundImageExploded[count($backgroundImageExploded)-1] : $backgroundImage; - - throw new Exception('Invalid background image: ' . $imageFileName); - } - - // check image type - $finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension - $imageType = finfo_file($finfo, $backgroundImage); - finfo_close($finfo); - - if (!in_array($imageType, $this->allowedBackgroundImageTypes)) { - throw new Exception('Invalid background image type! Allowed types are: ' . join(', ', $this->allowedBackgroundImageTypes)); - } - - return $imageType; - } - - /** - * Create background image from type - * - * @param string $backgroundImage - * @param string $imageType - * @return resource - * @throws Exception - */ - protected function createBackgroundImageFromType($backgroundImage, $imageType) - { - switch ($imageType) { - case 'image/jpeg': - $image = imagecreatefromjpeg($backgroundImage); - break; - case 'image/png': - $image = imagecreatefrompng($backgroundImage); - break; - case 'image/gif': - $image = imagecreatefromgif($backgroundImage); - break; - - default: - throw new Exception('Not supported file type for background image!'); - break; - } - - return $image; - } -}
vendor/gregwar/captcha/src/Gregwar/Captcha/Font/captcha0.ttf+0 −0 removedvendor/gregwar/captcha/src/Gregwar/Captcha/Font/captcha1.ttf+0 −0 removedvendor/gregwar/captcha/src/Gregwar/Captcha/Font/captcha2.ttf+0 −0 removedvendor/gregwar/captcha/src/Gregwar/Captcha/Font/captcha3.ttf+0 −0 removedvendor/gregwar/captcha/src/Gregwar/Captcha/Font/captcha4.ttf+0 −0 removedvendor/gregwar/captcha/src/Gregwar/Captcha/Font/captcha5.ttf+0 −0 removedvendor/gregwar/captcha/src/Gregwar/Captcha/ImageFileHandler.php+0 −105 removed@@ -1,105 +0,0 @@ -<?php - -namespace Gregwar\Captcha; - -use Symfony\Component\Finder\Finder; - -/** - * Handles actions related to captcha image files including saving and garbage collection - * - * @author Gregwar <g.passault@gmail.com> - * @author Jeremy Livingston <jeremy@quizzle.com> - */ -class ImageFileHandler -{ - /** - * Name of folder for captcha images - * @var string - */ - protected $imageFolder; - - /** - * Absolute path to public web folder - * @var string - */ - protected $webPath; - - /** - * Frequency of garbage collection in fractions of 1 - * @var int - */ - protected $gcFreq; - - /** - * Maximum age of images in minutes - * @var int - */ - protected $expiration; - - /** - * @param $imageFolder - * @param $webPath - * @param $gcFreq - * @param $expiration - */ - public function __construct($imageFolder, $webPath, $gcFreq, $expiration) - { - $this->imageFolder = $imageFolder; - $this->webPath = $webPath; - $this->gcFreq = $gcFreq; - $this->expiration = $expiration; - } - - /** - * Saves the provided image content as a file - * - * @param string $contents - * - * @return string - */ - public function saveAsFile($contents) - { - $this->createFolderIfMissing(); - - $filename = md5(uniqid()) . '.jpg'; - $filePath = $this->webPath . '/' . $this->imageFolder . '/' . $filename; - imagejpeg($contents, $filePath, 15); - - return '/' . $this->imageFolder . '/' . $filename; - } - - /** - * Randomly runs garbage collection on the image directory - * - * @return bool - */ - public function collectGarbage() - { - if (!mt_rand(1, $this->gcFreq) == 1) { - return false; - } - - $this->createFolderIfMissing(); - - $finder = new Finder(); - $criteria = sprintf('<= now - %s minutes', $this->expiration); - $finder->in($this->webPath . '/' . $this->imageFolder) - ->date($criteria); - - foreach ($finder->files() as $file) { - unlink($file->getPathname()); - } - - return true; - } - - /** - * Creates the folder if it doesn't exist - */ - protected function createFolderIfMissing() - { - if (!file_exists($this->webPath . '/' . $this->imageFolder)) { - mkdir($this->webPath . '/' . $this->imageFolder, 0755); - } - } -}
vendor/gregwar/captcha/src/Gregwar/Captcha/PhraseBuilderInterface.php+0 −21 removed@@ -1,21 +0,0 @@ -<?php - -namespace Gregwar\Captcha; - -/** - * Interface for the PhraseBuilder - * - * @author Gregwar <g.passault@gmail.com> - */ -interface PhraseBuilderInterface -{ - /** - * Generates random phrase of given length with given charset - */ - public function build(); - - /** - * "Niceize" a code - */ - public function niceize($str); -}
vendor/gregwar/captcha/src/Gregwar/Captcha/PhraseBuilder.php+0 −59 removed@@ -1,59 +0,0 @@ -<?php - -namespace Gregwar\Captcha; - -/** - * Generates random phrase - * - * @author Gregwar <g.passault@gmail.com> - */ -class PhraseBuilder implements PhraseBuilderInterface -{ - /** - * @var int - */ - public $length; - - /** - * @var string - */ - public $charset; - /** - * Constructs a PhraseBuilder with given parameters - */ - public function __construct($length = 5, $charset = 'abcdefghijklmnpqrstuvwxyz123456789') - { - $this->length = $length; - $this->charset = $charset; - } - - /** - * Generates random phrase of given length with given charset - */ - public function build($length = null, $charset = null) - { - if ($length !== null) { - $this->length = $length; - } - if ($charset !== null) { - $this->charset = $charset; - } - - $phrase = ''; - $chars = str_split($this->charset); - - for ($i = 0; $i < $this->length; $i++) { - $phrase .= $chars[array_rand($chars)]; - } - - return $phrase; - } - - /** - * "Niceize" a code - */ - public function niceize($str) - { - return strtr(strtolower($str), '01', 'ol'); - } -}
vendor/symfony/finder/Comparator/Comparator.php+0 −98 removed@@ -1,98 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * Comparator. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class Comparator -{ - private $target; - private $operator = '=='; - - /** - * Gets the target value. - * - * @return string The target value - */ - public function getTarget() - { - return $this->target; - } - - /** - * Sets the target value. - * - * @param string $target The target value - */ - public function setTarget($target) - { - $this->target = $target; - } - - /** - * Gets the comparison operator. - * - * @return string The operator - */ - public function getOperator() - { - return $this->operator; - } - - /** - * Sets the comparison operator. - * - * @param string $operator A valid operator - * - * @throws \InvalidArgumentException - */ - public function setOperator($operator) - { - if (!$operator) { - $operator = '=='; - } - - if (!in_array($operator, array('>', '<', '>=', '<=', '==', '!='))) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); - } - - $this->operator = $operator; - } - - /** - * Tests against the target. - * - * @param mixed $test A test value - * - * @return bool - */ - public function test($test) - { - switch ($this->operator) { - case '>': - return $test > $this->target; - case '>=': - return $test >= $this->target; - case '<': - return $test < $this->target; - case '<=': - return $test <= $this->target; - case '!=': - return $test != $this->target; - } - - return $test == $this->target; - } -}
vendor/symfony/finder/Comparator/DateComparator.php+0 −51 removed@@ -1,51 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * DateCompare compiles date comparisons. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class DateComparator extends Comparator -{ - /** - * @param string $test A comparison string - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); - } - - try { - $date = new \DateTime($matches[2]); - $target = $date->format('U'); - } catch (\Exception $e) { - throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); - } - - $operator = isset($matches[1]) ? $matches[1] : '=='; - if ('since' === $operator || 'after' === $operator) { - $operator = '>'; - } - - if ('until' === $operator || 'before' === $operator) { - $operator = '<'; - } - - $this->setOperator($operator); - $this->setTarget($target); - } -}
vendor/symfony/finder/Comparator/NumberComparator.php+0 −79 removed@@ -1,79 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * NumberComparator compiles a simple comparison to an anonymous - * subroutine, which you can call with a value to be tested again. - * - * Now this would be very pointless, if NumberCompare didn't understand - * magnitudes. - * - * The target value may use magnitudes of kilobytes (k, ki), - * megabytes (m, mi), or gigabytes (g, gi). Those suffixed - * with an i use the appropriate 2**n version in accordance with the - * IEC standard: http://physics.nist.gov/cuu/Units/binary.html - * - * Based on the Perl Number::Compare module. - * - * @author Fabien Potencier <fabien@symfony.com> PHP port - * @author Richard Clamp <richardc@unixbeard.net> Perl version - * @copyright 2004-2005 Fabien Potencier <fabien@symfony.com> - * @copyright 2002 Richard Clamp <richardc@unixbeard.net> - * - * @see http://physics.nist.gov/cuu/Units/binary.html - */ -class NumberComparator extends Comparator -{ - /** - * @param string|int $test A comparison string or an integer - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(?string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test)); - } - - $target = $matches[2]; - if (!is_numeric($target)) { - throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target)); - } - if (isset($matches[3])) { - // magnitude - switch (strtolower($matches[3])) { - case 'k': - $target *= 1000; - break; - case 'ki': - $target *= 1024; - break; - case 'm': - $target *= 1000000; - break; - case 'mi': - $target *= 1024 * 1024; - break; - case 'g': - $target *= 1000000000; - break; - case 'gi': - $target *= 1024 * 1024 * 1024; - break; - } - } - - $this->setTarget($target); - $this->setOperator(isset($matches[1]) ? $matches[1] : '=='); - } -}
vendor/symfony/finder/Exception/AccessDeniedException.php+0 −19 removed@@ -1,19 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> - */ -class AccessDeniedException extends \UnexpectedValueException -{ -}
vendor/symfony/finder/Finder.php+0 −738 removed@@ -1,738 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -use Symfony\Component\Finder\Comparator\DateComparator; -use Symfony\Component\Finder\Comparator\NumberComparator; -use Symfony\Component\Finder\Iterator\CustomFilterIterator; -use Symfony\Component\Finder\Iterator\DateRangeFilterIterator; -use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator; -use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator; -use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; -use Symfony\Component\Finder\Iterator\FilenameFilterIterator; -use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator; -use Symfony\Component\Finder\Iterator\SortableIterator; - -/** - * Finder allows to build rules to find files and directories. - * - * It is a thin wrapper around several specialized iterator classes. - * - * All rules may be invoked several times. - * - * All methods return the current Finder object to allow easy chaining: - * - * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class Finder implements \IteratorAggregate, \Countable -{ - const IGNORE_VCS_FILES = 1; - const IGNORE_DOT_FILES = 2; - - private $mode = 0; - private $names = array(); - private $notNames = array(); - private $exclude = array(); - private $filters = array(); - private $depths = array(); - private $sizes = array(); - private $followLinks = false; - private $sort = false; - private $ignore = 0; - private $dirs = array(); - private $dates = array(); - private $iterators = array(); - private $contains = array(); - private $notContains = array(); - private $paths = array(); - private $notPaths = array(); - private $ignoreUnreadableDirs = false; - - private static $vcsPatterns = array('.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg'); - - public function __construct() - { - $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; - } - - /** - * Creates a new Finder. - * - * @return static - */ - public static function create() - { - return new static(); - } - - /** - * Restricts the matching to directories only. - * - * @return $this - */ - public function directories() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; - - return $this; - } - - /** - * Restricts the matching to files only. - * - * @return $this - */ - public function files() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; - - return $this; - } - - /** - * Adds tests for the directory depth. - * - * Usage: - * - * $finder->depth('> 1') // the Finder will start matching at level 1. - * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. - * - * @param string|int $level The depth level expression - * - * @return $this - * - * @see DepthRangeFilterIterator - * @see NumberComparator - */ - public function depth($level) - { - $this->depths[] = new Comparator\NumberComparator($level); - - return $this; - } - - /** - * Adds tests for file dates (last modified). - * - * The date must be something that strtotime() is able to parse: - * - * $finder->date('since yesterday'); - * $finder->date('until 2 days ago'); - * $finder->date('> now - 2 hours'); - * $finder->date('>= 2005-10-15'); - * - * @param string $date A date range string - * - * @return $this - * - * @see strtotime - * @see DateRangeFilterIterator - * @see DateComparator - */ - public function date($date) - { - $this->dates[] = new Comparator\DateComparator($date); - - return $this; - } - - /** - * Adds rules that files must match. - * - * You can use patterns (delimited with / sign), globs or simple strings. - * - * $finder->name('*.php') - * $finder->name('/\.php$/') // same as above - * $finder->name('test.php') - * - * @param string $pattern A pattern (a regexp, a glob, or a string) - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function name($pattern) - { - $this->names[] = $pattern; - - return $this; - } - - /** - * Adds rules that files must not match. - * - * @param string $pattern A pattern (a regexp, a glob, or a string) - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notName($pattern) - { - $this->notNames[] = $pattern; - - return $this; - } - - /** - * Adds tests that file contents must match. - * - * Strings or PCRE patterns can be used: - * - * $finder->contains('Lorem ipsum') - * $finder->contains('/Lorem ipsum/i') - * - * @param string $pattern A pattern (string or regexp) - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function contains($pattern) - { - $this->contains[] = $pattern; - - return $this; - } - - /** - * Adds tests that file contents must not match. - * - * Strings or PCRE patterns can be used: - * - * $finder->notContains('Lorem ipsum') - * $finder->notContains('/Lorem ipsum/i') - * - * @param string $pattern A pattern (string or regexp) - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function notContains($pattern) - { - $this->notContains[] = $pattern; - - return $this; - } - - /** - * Adds rules that filenames must match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->path('some/special/dir') - * $finder->path('/some\/special\/dir/') // same as above - * - * Use only / as dirname separator. - * - * @param string $pattern A pattern (a regexp or a string) - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function path($pattern) - { - $this->paths[] = $pattern; - - return $this; - } - - /** - * Adds rules that filenames must not match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->notPath('some/special/dir') - * $finder->notPath('/some\/special\/dir/') // same as above - * - * Use only / as dirname separator. - * - * @param string $pattern A pattern (a regexp or a string) - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notPath($pattern) - { - $this->notPaths[] = $pattern; - - return $this; - } - - /** - * Adds tests for file sizes. - * - * $finder->size('> 10K'); - * $finder->size('<= 1Ki'); - * $finder->size(4); - * - * @param string|int $size A size range string or an integer - * - * @return $this - * - * @see SizeRangeFilterIterator - * @see NumberComparator - */ - public function size($size) - { - $this->sizes[] = new Comparator\NumberComparator($size); - - return $this; - } - - /** - * Excludes directories. - * - * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: - * - * $finder->in(__DIR__)->exclude('ruby'); - * - * @param string|array $dirs A directory path or an array of directories - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function exclude($dirs) - { - $this->exclude = array_merge($this->exclude, (array) $dirs); - - return $this; - } - - /** - * Excludes "hidden" directories and files (starting with a dot). - * - * This option is enabled by default. - * - * @param bool $ignoreDotFiles Whether to exclude "hidden" files or not - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreDotFiles($ignoreDotFiles) - { - if ($ignoreDotFiles) { - $this->ignore |= static::IGNORE_DOT_FILES; - } else { - $this->ignore &= ~static::IGNORE_DOT_FILES; - } - - return $this; - } - - /** - * Forces the finder to ignore version control directories. - * - * This option is enabled by default. - * - * @param bool $ignoreVCS Whether to exclude VCS files or not - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreVCS($ignoreVCS) - { - if ($ignoreVCS) { - $this->ignore |= static::IGNORE_VCS_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_FILES; - } - - return $this; - } - - /** - * Adds VCS patterns. - * - * @see ignoreVCS() - * - * @param string|string[] $pattern VCS patterns to ignore - */ - public static function addVCSPattern($pattern) - { - foreach ((array) $pattern as $p) { - self::$vcsPatterns[] = $p; - } - - self::$vcsPatterns = array_unique(self::$vcsPatterns); - } - - /** - * Sorts files and directories by an anonymous function. - * - * The anonymous function receives two \SplFileInfo instances to compare. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sort(\Closure $closure) - { - $this->sort = $closure; - - return $this; - } - - /** - * Sorts files and directories by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByName() - { - $this->sort = Iterator\SortableIterator::SORT_BY_NAME; - - return $this; - } - - /** - * Sorts files and directories by type (directories before files), then by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByType() - { - $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; - - return $this; - } - - /** - * Sorts files and directories by the last accessed time. - * - * This is the time that the file was last accessed, read or written to. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByAccessedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; - - return $this; - } - - /** - * Sorts files and directories by the last inode changed time. - * - * This is the time that the inode information was last modified (permissions, owner, group or other metadata). - * - * On Windows, since inode is not available, changed time is actually the file creation time. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByChangedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; - - return $this; - } - - /** - * Sorts files and directories by the last modified time. - * - * This is the last time the actual contents of the file were last modified. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByModifiedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; - - return $this; - } - - /** - * Filters the iterator with an anonymous function. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @return $this - * - * @see CustomFilterIterator - */ - public function filter(\Closure $closure) - { - $this->filters[] = $closure; - - return $this; - } - - /** - * Forces the following of symlinks. - * - * @return $this - */ - public function followLinks() - { - $this->followLinks = true; - - return $this; - } - - /** - * Tells finder to ignore unreadable directories. - * - * By default, scanning unreadable directories content throws an AccessDeniedException. - * - * @param bool $ignore - * - * @return $this - */ - public function ignoreUnreadableDirs($ignore = true) - { - $this->ignoreUnreadableDirs = (bool) $ignore; - - return $this; - } - - /** - * Searches files and directories which match defined rules. - * - * @param string|array $dirs A directory path or an array of directories - * - * @return $this - * - * @throws \InvalidArgumentException if one of the directories does not exist - */ - public function in($dirs) - { - $resolvedDirs = array(); - - foreach ((array) $dirs as $dir) { - if (is_dir($dir)) { - $resolvedDirs[] = $this->normalizeDir($dir); - } elseif ($glob = glob($dir, (defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) { - $resolvedDirs = array_merge($resolvedDirs, array_map(array($this, 'normalizeDir'), $glob)); - } else { - throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir)); - } - } - - $this->dirs = array_merge($this->dirs, $resolvedDirs); - - return $this; - } - - /** - * Returns an Iterator for the current Finder configuration. - * - * This method implements the IteratorAggregate interface. - * - * @return \Iterator|SplFileInfo[] An iterator - * - * @throws \LogicException if the in() method has not been called - */ - public function getIterator() - { - if (0 === count($this->dirs) && 0 === count($this->iterators)) { - throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); - } - - if (1 === count($this->dirs) && 0 === count($this->iterators)) { - return $this->searchInDirectory($this->dirs[0]); - } - - $iterator = new \AppendIterator(); - foreach ($this->dirs as $dir) { - $iterator->append($this->searchInDirectory($dir)); - } - - foreach ($this->iterators as $it) { - $iterator->append($it); - } - - return $iterator; - } - - /** - * Appends an existing set of files/directories to the finder. - * - * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. - * - * @param mixed $iterator - * - * @return $this - * - * @throws \InvalidArgumentException when the given argument is not iterable - */ - public function append($iterator) - { - if ($iterator instanceof \IteratorAggregate) { - $this->iterators[] = $iterator->getIterator(); - } elseif ($iterator instanceof \Iterator) { - $this->iterators[] = $iterator; - } elseif ($iterator instanceof \Traversable || is_array($iterator)) { - $it = new \ArrayIterator(); - foreach ($iterator as $file) { - $it->append($file instanceof \SplFileInfo ? $file : new \SplFileInfo($file)); - } - $this->iterators[] = $it; - } else { - throw new \InvalidArgumentException('Finder::append() method wrong argument type.'); - } - - return $this; - } - - /** - * Check if the any results were found. - * - * @return bool - */ - public function hasResults() - { - foreach ($this->getIterator() as $_) { - return true; - } - - return false; - } - - /** - * Counts all the results collected by the iterators. - * - * @return int - */ - public function count() - { - return iterator_count($this->getIterator()); - } - - private function searchInDirectory(string $dir): \Iterator - { - if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { - $this->exclude = array_merge($this->exclude, self::$vcsPatterns); - } - - if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { - $this->notPaths[] = '#(^|/)\..+(/|$)#'; - } - - $minDepth = 0; - $maxDepth = PHP_INT_MAX; - - foreach ($this->depths as $comparator) { - switch ($comparator->getOperator()) { - case '>': - $minDepth = $comparator->getTarget() + 1; - break; - case '>=': - $minDepth = $comparator->getTarget(); - break; - case '<': - $maxDepth = $comparator->getTarget() - 1; - break; - case '<=': - $maxDepth = $comparator->getTarget(); - break; - default: - $minDepth = $maxDepth = $comparator->getTarget(); - } - } - - $flags = \RecursiveDirectoryIterator::SKIP_DOTS; - - if ($this->followLinks) { - $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; - } - - $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); - - if ($this->exclude) { - $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $this->exclude); - } - - $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); - - if ($minDepth > 0 || $maxDepth < PHP_INT_MAX) { - $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); - } - - if ($this->mode) { - $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode); - } - - if ($this->names || $this->notNames) { - $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames); - } - - if ($this->contains || $this->notContains) { - $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains); - } - - if ($this->sizes) { - $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes); - } - - if ($this->dates) { - $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates); - } - - if ($this->filters) { - $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); - } - - if ($this->paths || $this->notPaths) { - $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $this->notPaths); - } - - if ($this->sort) { - $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort); - $iterator = $iteratorAggregate->getIterator(); - } - - return $iterator; - } - - /** - * Normalizes given directory names by removing trailing slashes. - * - * @param string $dir - * - * @return string - */ - private function normalizeDir($dir) - { - return rtrim($dir, '/'.\DIRECTORY_SEPARATOR); - } -}
vendor/symfony/finder/Glob.php+0 −116 removed@@ -1,116 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Glob matches globbing patterns against text. - * - * if match_glob("foo.*", "foo.bar") echo "matched\n"; - * - * // prints foo.bar and foo.baz - * $regex = glob_to_regex("foo.*"); - * for (array('foo.bar', 'foo.baz', 'foo', 'bar') as $t) - * { - * if (/$regex/) echo "matched: $car\n"; - * } - * - * Glob implements glob(3) style matching that can be used to match - * against text, rather than fetching names from a filesystem. - * - * Based on the Perl Text::Glob module. - * - * @author Fabien Potencier <fabien@symfony.com> PHP port - * @author Richard Clamp <richardc@unixbeard.net> Perl version - * @copyright 2004-2005 Fabien Potencier <fabien@symfony.com> - * @copyright 2002 Richard Clamp <richardc@unixbeard.net> - */ -class Glob -{ - /** - * Returns a regexp which is the equivalent of the glob pattern. - * - * @param string $glob The glob pattern - * @param bool $strictLeadingDot - * @param bool $strictWildcardSlash - * @param string $delimiter Optional delimiter - * - * @return string regex The regexp - */ - public static function toRegex($glob, $strictLeadingDot = true, $strictWildcardSlash = true, $delimiter = '#') - { - $firstByte = true; - $escaping = false; - $inCurlies = 0; - $regex = ''; - $sizeGlob = strlen($glob); - for ($i = 0; $i < $sizeGlob; ++$i) { - $car = $glob[$i]; - if ($firstByte && $strictLeadingDot && '.' !== $car) { - $regex .= '(?=[^\.])'; - } - - $firstByte = '/' === $car; - - if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) { - $car = '[^/]++/'; - if (!isset($glob[$i + 3])) { - $car .= '?'; - } - - if ($strictLeadingDot) { - $car = '(?=[^\.])'.$car; - } - - $car = '/(?:'.$car.')*'; - $i += 2 + isset($glob[$i + 3]); - - if ('/' === $delimiter) { - $car = str_replace('/', '\\/', $car); - } - } - - if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { - $regex .= "\\$car"; - } elseif ('*' === $car) { - $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); - } elseif ('?' === $car) { - $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); - } elseif ('{' === $car) { - $regex .= $escaping ? '\\{' : '('; - if (!$escaping) { - ++$inCurlies; - } - } elseif ('}' === $car && $inCurlies) { - $regex .= $escaping ? '}' : ')'; - if (!$escaping) { - --$inCurlies; - } - } elseif (',' === $car && $inCurlies) { - $regex .= $escaping ? ',' : '|'; - } elseif ('\\' === $car) { - if ($escaping) { - $regex .= '\\\\'; - $escaping = false; - } else { - $escaping = true; - } - - continue; - } else { - $regex .= $car; - } - $escaping = false; - } - - return $delimiter.'^'.$regex.'$'.$delimiter; - } -}
vendor/symfony/finder/Iterator/CustomFilterIterator.php+0 −61 removed@@ -1,61 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * CustomFilterIterator filters files by applying anonymous functions. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class CustomFilterIterator extends \FilterIterator -{ - private $filters = array(); - - /** - * @param \Iterator $iterator The Iterator to filter - * @param callable[] $filters An array of PHP callbacks - * - * @throws \InvalidArgumentException - */ - public function __construct(\Iterator $iterator, array $filters) - { - foreach ($filters as $filter) { - if (!is_callable($filter)) { - throw new \InvalidArgumentException('Invalid PHP callback.'); - } - } - $this->filters = $filters; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $fileinfo = $this->current(); - - foreach ($this->filters as $filter) { - if (false === call_user_func($filter, $fileinfo)) { - return false; - } - } - - return true; - } -}
vendor/symfony/finder/Iterator/DateRangeFilterIterator.php+0 −58 removed@@ -1,58 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\DateComparator; - -/** - * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class DateRangeFilterIterator extends \FilterIterator -{ - private $comparators = array(); - - /** - * @param \Iterator $iterator The Iterator to filter - * @param DateComparator[] $comparators An array of DateComparator instances - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $fileinfo = $this->current(); - - if (!file_exists($fileinfo->getPathname())) { - return false; - } - - $filedate = $fileinfo->getMTime(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filedate)) { - return false; - } - } - - return true; - } -}
vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php+0 −45 removed@@ -1,45 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * DepthRangeFilterIterator limits the directory depth. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class DepthRangeFilterIterator extends \FilterIterator -{ - private $minDepth = 0; - - /** - * @param \RecursiveIteratorIterator $iterator The Iterator to filter - * @param int $minDepth The min depth - * @param int $maxDepth The max depth - */ - public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = PHP_INT_MAX) - { - $this->minDepth = $minDepth; - $iterator->setMaxDepth(PHP_INT_MAX === $maxDepth ? -1 : $maxDepth); - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - return $this->getInnerIterator()->getDepth() >= $this->minDepth; - } -}
vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php+0 −84 removed@@ -1,84 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * ExcludeDirectoryFilterIterator filters out directories. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator -{ - private $iterator; - private $isRecursive; - private $excludedDirs = array(); - private $excludedPattern; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param array $directories An array of directories to exclude - */ - public function __construct(\Iterator $iterator, array $directories) - { - $this->iterator = $iterator; - $this->isRecursive = $iterator instanceof \RecursiveIterator; - $patterns = array(); - foreach ($directories as $directory) { - $directory = rtrim($directory, '/'); - if (!$this->isRecursive || false !== strpos($directory, '/')) { - $patterns[] = preg_quote($directory, '#'); - } else { - $this->excludedDirs[$directory] = true; - } - } - if ($patterns) { - $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; - } - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool True if the value should be kept, false otherwise - */ - public function accept() - { - if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { - return false; - } - - if ($this->excludedPattern) { - $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath(); - $path = str_replace('\\', '/', $path); - - return !preg_match($this->excludedPattern, $path); - } - - return true; - } - - public function hasChildren() - { - return $this->isRecursive && $this->iterator->hasChildren(); - } - - public function getChildren() - { - $children = new self($this->iterator->getChildren(), array()); - $children->excludedDirs = $this->excludedDirs; - $children->excludedPattern = $this->excludedPattern; - - return $children; - } -}
vendor/symfony/finder/Iterator/FilecontentFilterIterator.php+0 −58 removed@@ -1,58 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). - * - * @author Fabien Potencier <fabien@symfony.com> - * @author Włodzimierz Gajda <gajdaw@gajdaw.pl> - */ -class FilecontentFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - if (!$this->matchRegexps && !$this->noMatchRegexps) { - return true; - } - - $fileinfo = $this->current(); - - if ($fileinfo->isDir() || !$fileinfo->isReadable()) { - return false; - } - - $content = $fileinfo->getContents(); - if (!$content) { - return false; - } - - return $this->isAccepted($content); - } - - /** - * Converts string to regexp if necessary. - * - * @param string $str Pattern: string or regexp - * - * @return string regexp corresponding to a given string or regexp - */ - protected function toRegex($str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -}
vendor/symfony/finder/Iterator/FilenameFilterIterator.php+0 −47 removed@@ -1,47 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Glob; - -/** - * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class FilenameFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - return $this->isAccepted($this->current()->getFilename()); - } - - /** - * Converts glob to regexp. - * - * PCRE patterns are left unchanged. - * Glob strings are transformed with Glob::toRegex(). - * - * @param string $str Pattern: glob or regexp - * - * @return string regexp corresponding to a given glob or regexp - */ - protected function toRegex($str) - { - return $this->isRegex($str) ? $str : Glob::toRegex($str); - } -}
vendor/symfony/finder/Iterator/FileTypeFilterIterator.php+0 −53 removed@@ -1,53 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FileTypeFilterIterator only keeps files, directories, or both. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class FileTypeFilterIterator extends \FilterIterator -{ - const ONLY_FILES = 1; - const ONLY_DIRECTORIES = 2; - - private $mode; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) - */ - public function __construct(\Iterator $iterator, int $mode) - { - $this->mode = $mode; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $fileinfo = $this->current(); - if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { - return false; - } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) { - return false; - } - - return true; - } -}
vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php+0 −112 removed@@ -1,112 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). - * - * @author Fabien Potencier <fabien@symfony.com> - */ -abstract class MultiplePcreFilterIterator extends \FilterIterator -{ - protected $matchRegexps = array(); - protected $noMatchRegexps = array(); - - /** - * @param \Iterator $iterator The Iterator to filter - * @param array $matchPatterns An array of patterns that need to match - * @param array $noMatchPatterns An array of patterns that need to not match - */ - public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) - { - foreach ($matchPatterns as $pattern) { - $this->matchRegexps[] = $this->toRegex($pattern); - } - - foreach ($noMatchPatterns as $pattern) { - $this->noMatchRegexps[] = $this->toRegex($pattern); - } - - parent::__construct($iterator); - } - - /** - * Checks whether the string is accepted by the regex filters. - * - * If there is no regexps defined in the class, this method will accept the string. - * Such case can be handled by child classes before calling the method if they want to - * apply a different behavior. - * - * @param string $string The string to be matched against filters - * - * @return bool - */ - protected function isAccepted($string) - { - // should at least not match one rule to exclude - foreach ($this->noMatchRegexps as $regex) { - if (preg_match($regex, $string)) { - return false; - } - } - - // should at least match one rule - if ($this->matchRegexps) { - foreach ($this->matchRegexps as $regex) { - if (preg_match($regex, $string)) { - return true; - } - } - - return false; - } - - // If there is no match rules, the file is accepted - return true; - } - - /** - * Checks whether the string is a regex. - * - * @param string $str - * - * @return bool Whether the given string is a regex - */ - protected function isRegex($str) - { - if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) { - $start = substr($m[1], 0, 1); - $end = substr($m[1], -1); - - if ($start === $end) { - return !preg_match('/[*?[:alnum:] \\\\]/', $start); - } - - foreach (array(array('{', '}'), array('(', ')'), array('[', ']'), array('<', '>')) as $delimiters) { - if ($start === $delimiters[0] && $end === $delimiters[1]) { - return true; - } - } - } - - return false; - } - - /** - * Converts string into regexp. - * - * @param string $str Pattern - * - * @return string regexp corresponding to a given string - */ - abstract protected function toRegex($str); -}
vendor/symfony/finder/Iterator/PathFilterIterator.php+0 −56 removed@@ -1,56 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * PathFilterIterator filters files by path patterns (e.g. some/special/dir). - * - * @author Fabien Potencier <fabien@symfony.com> - * @author Włodzimierz Gajda <gajdaw@gajdaw.pl> - */ -class PathFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $filename = $this->current()->getRelativePathname(); - - if ('\\' === DIRECTORY_SEPARATOR) { - $filename = str_replace('\\', '/', $filename); - } - - return $this->isAccepted($filename); - } - - /** - * Converts strings to regexp. - * - * PCRE patterns are left unchanged. - * - * Default conversion: - * 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' - * - * Use only / as directory separator (on Windows also). - * - * @param string $str Pattern: regexp or dirname - * - * @return string regexp corresponding to a given string or regexp - */ - protected function toRegex($str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -}
vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php+0 −140 removed@@ -1,140 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Exception\AccessDeniedException; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Extends the \RecursiveDirectoryIterator to support relative paths. - * - * @author Victor Berchet <victor@suumit.com> - */ -class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator -{ - /** - * @var bool - */ - private $ignoreUnreadableDirs; - - /** - * @var bool - */ - private $rewindable; - - // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private $rootPath; - private $subPath; - private $directorySeparator = '/'; - - /** - * @throws \RuntimeException - */ - public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) - { - if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) { - throw new \RuntimeException('This iterator only support returning current as fileinfo.'); - } - - parent::__construct($path, $flags); - $this->ignoreUnreadableDirs = $ignoreUnreadableDirs; - $this->rootPath = $path; - if ('/' !== DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) { - $this->directorySeparator = DIRECTORY_SEPARATOR; - } - } - - /** - * Return an instance of SplFileInfo with support for relative paths. - * - * @return SplFileInfo File information - */ - public function current() - { - // the logic here avoids redoing the same work in all iterations - - if (null === $subPathname = $this->subPath) { - $subPathname = $this->subPath = (string) $this->getSubPath(); - } - if ('' !== $subPathname) { - $subPathname .= $this->directorySeparator; - } - $subPathname .= $this->getFilename(); - - return new SplFileInfo($this->rootPath.$this->directorySeparator.$subPathname, $this->subPath, $subPathname); - } - - /** - * @return \RecursiveIterator - * - * @throws AccessDeniedException - */ - public function getChildren() - { - try { - $children = parent::getChildren(); - - if ($children instanceof self) { - // parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore - $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; - - // performance optimization to avoid redoing the same work in all children - $children->rewindable = &$this->rewindable; - $children->rootPath = $this->rootPath; - } - - return $children; - } catch (\UnexpectedValueException $e) { - if ($this->ignoreUnreadableDirs) { - // If directory is unreadable and finder is set to ignore it, a fake empty content is returned. - return new \RecursiveArrayIterator(array()); - } else { - throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e); - } - } - } - - /** - * Do nothing for non rewindable stream. - */ - public function rewind() - { - if (false === $this->isRewindable()) { - return; - } - - parent::rewind(); - } - - /** - * Checks if the stream is rewindable. - * - * @return bool true when the stream is rewindable, false otherwise - */ - public function isRewindable() - { - if (null !== $this->rewindable) { - return $this->rewindable; - } - - if (false !== $stream = @opendir($this->getPath())) { - $infos = stream_get_meta_data($stream); - closedir($stream); - - if ($infos['seekable']) { - return $this->rewindable = true; - } - } - - return $this->rewindable = false; - } -}
vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php+0 −57 removed@@ -1,57 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\NumberComparator; - -/** - * SizeRangeFilterIterator filters out files that are not in the given size range. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class SizeRangeFilterIterator extends \FilterIterator -{ - private $comparators = array(); - - /** - * @param \Iterator $iterator The Iterator to filter - * @param NumberComparator[] $comparators An array of NumberComparator instances - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool true if the value should be kept, false otherwise - */ - public function accept() - { - $fileinfo = $this->current(); - if (!$fileinfo->isFile()) { - return true; - } - - $filesize = $fileinfo->getSize(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filesize)) { - return false; - } - } - - return true; - } -}
vendor/symfony/finder/Iterator/SortableIterator.php+0 −80 removed@@ -1,80 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * SortableIterator applies a sort on a given Iterator. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class SortableIterator implements \IteratorAggregate -{ - const SORT_BY_NAME = 1; - const SORT_BY_TYPE = 2; - const SORT_BY_ACCESSED_TIME = 3; - const SORT_BY_CHANGED_TIME = 4; - const SORT_BY_MODIFIED_TIME = 5; - - private $iterator; - private $sort; - - /** - * @param \Traversable $iterator The Iterator to filter - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) - * - * @throws \InvalidArgumentException - */ - public function __construct(\Traversable $iterator, $sort) - { - $this->iterator = $iterator; - - if (self::SORT_BY_NAME === $sort) { - $this->sort = function ($a, $b) { - return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_TYPE === $sort) { - $this->sort = function ($a, $b) { - if ($a->isDir() && $b->isFile()) { - return -1; - } elseif ($a->isFile() && $b->isDir()) { - return 1; - } - - return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = function ($a, $b) { - return $a->getATime() - $b->getATime(); - }; - } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = function ($a, $b) { - return $a->getCTime() - $b->getCTime(); - }; - } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = function ($a, $b) { - return $a->getMTime() - $b->getMTime(); - }; - } elseif (is_callable($sort)) { - $this->sort = $sort; - } else { - throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); - } - } - - public function getIterator() - { - $array = iterator_to_array($this->iterator, true); - uasort($array, $this->sort); - - return new \ArrayIterator($array); - } -}
vendor/symfony/finder/LICENSE+0 −19 removed@@ -1,19 +0,0 @@ -Copyright (c) 2004-2018 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.
vendor/symfony/finder/SplFileInfo.php+0 −78 removed@@ -1,78 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Extends \SplFileInfo to support relative paths. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class SplFileInfo extends \SplFileInfo -{ - private $relativePath; - private $relativePathname; - - /** - * @param string $file The file name - * @param string $relativePath The relative path - * @param string $relativePathname The relative path name - */ - public function __construct(string $file, string $relativePath, string $relativePathname) - { - parent::__construct($file); - $this->relativePath = $relativePath; - $this->relativePathname = $relativePathname; - } - - /** - * Returns the relative path. - * - * This path does not contain the file name. - * - * @return string the relative path - */ - public function getRelativePath() - { - return $this->relativePath; - } - - /** - * Returns the relative path name. - * - * This path contains the file name. - * - * @return string the relative path name - */ - public function getRelativePathname() - { - return $this->relativePathname; - } - - /** - * Returns the contents of the file. - * - * @return string the contents of the file - * - * @throws \RuntimeException - */ - public function getContents() - { - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - $content = file_get_contents($this->getPathname()); - restore_error_handler(); - if (false === $content) { - throw new \RuntimeException($error); - } - - return $content; - } -}
vendor/vinades/nukeviet/Core/Request.php+6 −39 modified@@ -765,28 +765,6 @@ private function parse_mode($mode) return array_values($mode); } - /** - * Request::base64Encode() - * - * @param mixed $input - * @return - */ - private function base64Encode($input) - { - return strtr(base64_encode($input), '+/=', '-_,'); - } - - /** - * Request::base64Decode() - * - * @param mixed $input - * @return - */ - private function base64Decode($input) - { - return base64_decode(strtr($input, '-_,', '+/=')); - } - /** * Request::encodeCookie() * @@ -795,14 +773,9 @@ private function base64Decode($input) */ private function encodeCookie($string) { - $result = ''; - $strlen = strlen($string); - for ($i = 0; $i < $strlen; ++$i) { - $char = substr($string, $i, 1); - $keychar = substr($this->cookie_key, ($i % 32) - 1, 1); - $result .= chr(ord($char) + ord($keychar)); - } - return $this->base64Encode($result); + $iv = substr($this->cookie_key, 0, 16); + $string = openssl_encrypt($string, 'aes-256-cbc', $this->cookie_key, 0, $iv); + return strtr($string, '+/=', '-_,'); } /** @@ -813,15 +786,9 @@ private function encodeCookie($string) */ private function decodeCookie($string) { - $result = ''; - $string = $this->base64Decode($string); - $strlen = strlen($string); - for ($i = 0; $i < $strlen; ++$i) { - $char = substr($string, $i, 1); - $keychar = substr($this->cookie_key, ($i % 32) - 1, 1); - $result .= chr(ord($char) - ord($keychar)); - } - return $result; + $string = strtr($string, '-_,', '+/='); + $iv = substr($this->cookie_key, 0, 16); + return openssl_decrypt($string, 'aes-256-cbc', $this->cookie_key, 0, $iv); } /**
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-32wr-8wxm-852cghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2019-7725ghsaADVISORY
- github.com/nukeviet/nukeviet/blob/4.3.04/CHANGELOG.txtghsax_refsource_MISCWEB
- github.com/nukeviet/nukeviet/blob/nukeviet4.3/CHANGELOG.txtghsax_refsource_MISCWEB
- github.com/nukeviet/nukeviet/compare/4.3.03...4.3.04ghsax_refsource_CONFIRMWEB
- github.com/nukeviet/nukeviet/pull/2740/commits/05dfb9b4531f12944fe39556f58449b9a56241beghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.